CMMI 1.3版エンジニアリングのプロセス領域

平成30年度 システムアーキテクト試験 午前IIより
プロセス領域とは何か?より引用

【要件開発】顧客要件、成果物要件、および成果物構成要素の要件を引き出し、分析し、そして確立すること
【技術解】要件に対する解を選定し、設計し、そして実装することである。解、設計、および実装は、単体の、または適宜組み合わせた成果物、成果物構成要素、および成果物関連のライフサイクルプロセスを網羅すること
【成果物統合】 成果物構成要素から成果物を組み立て、統合されたものとして成果物が適切に動く (必要とされる機能性および品質属性を備えている) ようにし、そしてその成果物を納入すること
【検証】選択された作業成果物が、指定された要件を満たすようにすること
【妥当性確認】 成果物または成果物構成要素が、意図された環境に設置されたときにその意図された用途を充足することを実証すること

システムアーキテクト試験

初めて受験したが、論文で不合格になってしまった。ITサービスマネージャ試験を2年前に合格して以来不合格が続き、来春受験予定のシステム監査試験は午前I免除なしで、かなりしんどい試験になりそう。 ちなみにシステム監査試験は27年度に午後IIで論文でBランクになった後、29年度、30年度は午後Iで連続不合格になっているだけに、午後Iの対策がとても重要。。。。

受験番号  SA542-0124 の方は,   不合格   です

午前Ⅰ得点***.**点
午前Ⅱ得点72.00点
午後Ⅰ得点71点
午後Ⅱ評価ランクB

VMをVLANと接続する

VMWareの仮想マシンをVLANと接続するためには、仮想マシンにVLAN設定する方法もあるが、vSwitchのVLAN設定を変更することで仮想マシンVLAN設定する必要なくVLANに参加させることができる。

ESXi とタグ VLAN の組み合わせかたに詳しいが、VLAN IDをvSwitchにて設定して紐づけすること(External Switch Tagging (EST))で設定できる。

【VMware vSphere 6 ESXi】 ネットワークの概念まとめも併せて参考にするとよい。

EC2インスタンス、RDSインスタンスを指定時間に起動及び停止する

下記を参考にして、CloudWatch+Lambdaの組み合わせを用いて、タグ指定でインスタンスの開始、停止を実装してみた。
できるだけシンプルな仕組みで簡単にEC2の自動起動・停止を実現したい!
AWS Lambda+Python3で複数のRDSを起動停止

開発環境など業務時間内のみインスタンスを稼働させ、コストを最小化させたいときに役に立つ。

EC2インスタンスの場合
Lambda関数に設定する実行ロール

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:PutLogEvents"
            ],
            "Resource": "arn:aws:logs:*:*:*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeInstances",
                "ec2:StartInstances",
                "ec2:StopInstances"
            ],
            "Resource": "*"
        }
    ]
}

Lambda関数(ec2.describe_instances()の戻りデータがそれなりに大きいので、タイムアウトをデフォルトの3秒より少し長めにしておかないとタイムアウトしてしまう)

import boto3

"""
  Request 4Parameters
    Region
    Action(start or stop)
    TagName
    TagValue
"""

def lambda_handler(event, context):
    region = event['Region']
    action = event['Action']
    tagname = event['TagName']
    tagvalue = event['TagValue']
    ec2 = boto3.client('ec2', region_name=region)
    try:
        reservations = ec2.describe_instances()
    except Exception as e:
        print(e)
        return { 'status': -1 }

    if action == 'start':
        for instances in reservations["Reservations"]:
            for instance in instances['Instances']:
                tags = instance['Tags']
                tag = next(iter(filter(lambda tag: tag['Key'] == tagname and tag['Value'] == tagvalue, tags)), None)
                if tag:
                    if instance['State']['Name'] == 'stopped':
                        response = ec2.start_instances(InstanceIds=[instance["InstanceId"]])
                        print(instance['InstanceId'] + " is starting!")
                    else:
                        print(instance['InstanceId'] + " is already started!")
    elif action == 'stop':
        for instances in reservations["Reservations"]:
            for instance in instances['Instances']:
                tags = instance['Tags']
                tag = next(iter(filter(lambda tag: tag['Key'] == tagname and tag['Value'] == tagvalue, tags)), None)
                if tag:
                    if instance['State']['Name'] == 'running':
                        response = ec2.stop_instances(InstanceIds=[instance["InstanceId"]])
                        print(instance['InstanceId'] + " is stopping!")
                    else:
                        print(instance['InstanceId'] + " is already stopped!")
    return { 'status': 0 }

CloudWatchEventで設定するターゲットの入力値(定数 (JSON テキスト))

{
  "Action": "start",
  "Region": "ap-northeast-1",
  "TagName": "AutoStart",
  "TagValue": "true"
}

上記を設定すると、東京リージョン(ap-northeast-1)にあるAutoStart=Trueとタグ設定されたEC2インスタンスが起動するようになります。Actionをstopとすると停止になります。

RDSインスタンスの場合
Lambda関数に設定する実行ロール

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:PutLogEvents"
            ],
            "Resource": "arn:aws:logs:*:*:*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "rds:DescribeDBInstances",
                "rds:StopDBInstance",
                "rds:StartDBInstance",
                "rds:ListTagsForResource"
            ],
            "Resource": "*"
        }
    ]
}

Lambda関数

import boto3

"""
  Request 4Parameters
    Region
    Action(start or stop)
    TagName
    TagValue
"""

def lambda_handler(event, context):
    region = event['Region']
    action = event['Action']
    tagname = event['TagName']
    tagvalue = event['TagValue']
    rds = boto3.client('rds', region_name=region)
    try:
        dbs = rds.describe_db_instances()
    except Exception as e:
        print(e)
        return { 'status': -1 }

    if action == 'start':
        for db in dbs['DBInstances']:
            instance_arn = db['DBInstanceArn']
            instance_tags = rds.list_tags_for_resource(ResourceName=instance_arn)
            tags = instance_tags['TagList']
            tag = next(iter(filter(lambda tag: tag['Key'] == tagname and tag['Value'] == tagvalue, tags)), None)
            if tag:
                if db['DBInstanceStatus'] == 'stopped':
                    response = rds.start_db_instance(DBInstanceIdentifier=db["DBInstanceIdentifier"])
                    print(db['DBInstanceIdentifier'] + " is starting!")
                else:
                    print(db['DBInstanceIdentifier'] + " is already started!")
    elif action == 'stop':
        for db in dbs['DBInstances']:
            instance_arn = db['DBInstanceArn']
            instance_tags = rds.list_tags_for_resource(ResourceName=instance_arn)
            tags = instance_tags['TagList']
            tag = next(iter(filter(lambda tag: tag['Key'] == tagname and tag['Value'] == tagvalue, tags)), None)
            if tag:
                if db['DBInstanceStatus'] == 'available':
                    response = rds.stop_db_instance(DBInstanceIdentifier=db["DBInstanceIdentifier"])
                    print(db['DBInstanceIdentifier'] + " is stopping!")
                else:
                    print(db['DBInstanceIdentifier'] + " is already stopped!")
    return { 'status': 0 }

参考)EC2とRDSのAPIに差異がある点に注意が必要。
例:EC2のstart_instancesは、リストで渡せる(Type: Array of strings)一方で、RDSのstart-db-instanceは、単一のIDしか渡せない(Type: String/リストで渡せない)。

re:Invent 2018 Second Day

明日はセミナー本番

受講予定のセミナーについて少し調べてみる。

ANT322-R – [REPEAT] High Performance Data Streaming with Amazon Kinesis: Best Practices

Amazon Kinesis makes it easy to collect, process, and analyze real-time, streaming data so you can get timely insights and react quickly to new information. In this session, we dive deep into best practices for Kinesis Data Streams and Kinesis Data Firehose to get the most performance out of your data streaming applications. Our customer NICE inContact joins us to discuss how they utilize Amazon Kinesis Data Streams to make real-time decisions on customer contact routing and agent assignments for its Call Center as a Service (CCaaS) Platform. NICE inContact walks through their architecture and requirements for low-latency, accurate processing to be as responsive as possible to changes.

終わり次第、
IOT314-R – [REPEAT] IoT Analytics Workshop
を見てみようかな。

In this workshop, you learn about the different components of AWS IoT Analytics. You have the opportunity to configure AWS IoT Analytics to ingest data from AWS IoT Core, enrich the data using AWS Lambda, visualize the data using Amazon QuickSight, and perform machine learning using Jupyter Notebooks. Join us, and build a solution that helps you perform analytics on appliance energy usage in a smart building and forecast energy utilization to optimize consumption.

DVC304 – Red Team vs. Blue Team on AWS

Red teamers, penetration testers, and attackers can leverage the same tools used by developers to attack AWS accounts. In this session, two technical security experts demonstrate how an attacker can perform reconnaissance and pivoting on AWS, leverage network, AWS Lambda functions, and implementation weaknesses to steal credentials and data. They then show you how to defend your environment from these threats.

This session is part of re:Invent Developer Community Day, a series led by AWS enthusiasts who share first-hand, technical insights on trending topics.

IOT322-R – [REPEAT] Machine Learning Inference at the Edge

Training ML models requires massive computing resources, so it is a natural fit for the cloud. But, inference typically takes a lot less computing power and is often done in real time when new data is available. So, getting inference results with very low latency is important to making sure your IoT applications can respond quickly to local events. AWS Greengrass ML Inference gives you the best of both worlds. You use ML models that are built and trained in the cloud and you deploy and run ML inference locally on connected devices. For example, you can build a predictive model in Amazon SageMaker for scene detection analysis and then run it locally on an AWS Greengrass enabled security camera device where there is no cloud connectivity to predict and send an alert when an incoming visitor is detected. We show you some examples of image recognition models running on edge devices.

場所がAriaで移動時間がかなり厳しいので、
CMP368-R – [REPEAT] Scalable Multi-Node Deep Learning Training in the Cloud

Developing and optimizing machine learning (ML) models is an iterative process. It involves frequently training and retraining models with new data and optimizing model and training parameters to increase prediction accuracy. At the same time, to drive higher prediction accuracy, models are getting larger and more complex, thus increasing the demand for compute resources. In this chalk talk, AWS and Fast.ai will share best practices on how to optimize AWS infrastructure to minimize deep learning training times by using distributed/multi-node training.

このセッションを聞くことにした。
CON308-R – [REPEAT] Building Microservices with Containers

Microservices are minimal function services that are deployed separately, but can interact together to function as a broader application. Microservices can be built, changed, and deployed quickly with a relatively small impact, empowering developers to speed up the rate of innovation. In this session, we show how containers help enable microservices-based application architectures, discuss best practices for building new microservices, and cover the AWS services that allow you to build performant microservices applications.

GENM201 – Monday Night Live

Want to enjoy live entertainment while learning about Amazon’s infrastructure updates? Be sure to attend Monday Night Live with Peter DeSantis, Vice President, AWS Global Infrastructure and Customer Support, on Nov. 26, at 7:30 PM at The Venetian, Level 2, Hall A.

財務報告の目的

日商簿記1級 第150回 会計学で出題されて面食らう。

財務会計の概念フレームワークによれば、
投資家による企業成果の予測や企業評価のために、将来キャッシュフローの予測に役立つ情報を提供すること
とのこと。(第2章 会計情報の質的特性 序章より)

25文字以内で答えなければならないので
将来キャッシュフローの予測に役立つ情報を提供する為
となるのだろうか?

利害関係者に対して投資判断に寄与する情報提供を行う
と答えてしまった。。。

AWS 機械学習 勉強会 in 福井に参加してきた

Amazon SageMakerを利用した機械学習のハンズオン。
内容は、AWSの亀田さんが講師をされ、オンラインで公開されているハンズオンの57スライド目からを利用して実際にハンズオンをやるというもの。

スライドの資料を利用すると大まかな内容が理解できる。

ハンズオンでは実際にzipファイルをダウンロードして展開されたJupyter Notebookよりここで進められるようになっているのだが、最初は進め方がよくわからず困惑した。[ ]をクリックすると[*]になってしばらくする(実際にデプロイしているので時間がかかるものがある)と[1]となるのだが、この部分を理解せずにやっていると途中で進められなくなったりして本質の理解(どのような原理で動いているか)を進めるのに時間を要してしまった。

受講した感想としては、zipファイルを実際に見てみないことには分かったような気にしかならないので、ここから理解をしていこうと思う。

機械学習のセミナー出ていたキーワード

男子の身長と体重のデータより女子の身長と体重の相関は導けない
→重要なことは目的に対応した学習用データの準備が必要

線形回帰
転移学習

実際に体験したアルゴリズム
XGBoost

RandomCutForest
波があるところに異常値をみつける

AWS ビジネス活用事例セミナーに参加してきた

AWSの亀田さんがAWSのサービスについて説明。
エンジニアの方もいたが、経営者の方も参加されていて、改めてAWSのサービスを理解するためには分かりやすいセミナーだった。

(備忘録)

AZとは、1~6のデータセンターで構成されている。東京リージョンは4つのAZがあるので、最小4、最大24のデータセンターで構成されている。東京と言ってもデータセンターの1つが東京にあるので、代表して東京リージョンとしている。
(実際の構成数やデータセンターの場所は非開示)
データセンター間のレイテンシーは0.25ms

複数のリージョン間通信はダークファイバーで接続されており、レイテンシーは2ms未満(ほぼ1ms未満)。

ローカルリージョンは1つのデータセンターで構成されている。世界で唯一大阪に存在ており、日本国内のニーズにある東西でDR対応したいユーザ要求にこたえている。但し、IXが東京に集中しており、関東が被災した場合に大阪リージョンが動いていたとしても通信がひっ迫してサービス提供ができない可能性がある点に留意が必要。

クラウドのメリット
・費用対効果が出しにくいサービスに適用しやすい
・撤退コストを最小化できる

クラウド移行によって、業務において手を付けられない業務:付帯業務の割合=30%:70%の場合に、70%:(クラウド管理)30%にすることが出来るが、40%増える余剰時間に対して、やってほしいことを伝えなければならない(IT部門が抵抗勢力になりうる)。

利用しなくなったログなどの過去データをLTO(テープ)などにオフラインバックアップすることが今までよくやられていたが、機械学習においては過去データを利用することになるので、機械学習においては適さない→ログデータもS3などにアップロードする必要が出てくる

コンテンツグラビティ
データと処理がクラウドに集まる

クラウドの利用のメリットには、財務効果+非財務効果(生産性向上、新機能リリース数、ダウンタイム低減)があるが、最大のメリットは、ビジネスニーズに迅速に対応できることである。

AWSのサービスはAmazonで実現しているサービスをパーツとして利用できるようにしたものである。例えば、セルフコンビニであるAmazon Goを基に
Amazon Kinesis Video Streams
Amazon Recognition
が提供されている。
(Recoginitonは画像だけだと思っていたが、動画もインプットにできることを知らなかった。。。)

その他のキーワード
・クラウドエコノミクス
・マネージドサービス(例:ロードバランサー)
・サーバレスコンピューティング
・プログラム実行基盤の実提供
NoSQL(DynamoDB)

異常に安いライセンスについて

Microsoft WindowsMicrosoft Officeなど異常に安い価格でライセンスキーを販売しているサイトがあるが、正規ライセンスキーであることは間違いない。

ただし、ボリュームライセンス契約に基づいたライセンスキーであるので再販されていること自体が利用契約に違反したものになってしまっている。

Microsoftより認証されなくなるようなケースも想定されるため、突如利用できなくなるリスクもあることから、安いからと言って購入しないように注意したい。

依存ライブラリをインストールする方法

yumでインストールする場合には依存関係を解決してくれるが、rpmでインストールしなければならないパッケージの場合には、依存関係によるエラーに見舞われる場合がある。

その場合に対象のライブラリを探すのはかなり一苦労だが、
yum search **/(ライブラリ名)
でライブラリを含んでいるパッケージを特定することが出来る。

RPM依存ライブラリ不足の問題はYUMに聞こう!によれば、yum whatprovidesを利用することもできるようだ。