ちょっと試しに、Serverless Framework を試してみた。 Serverless Framework Azure - Quick Start セットアップ方法 これはとても簡単。node v6.5.0以上が入っているなら次のでおっけー。なんの問題もなくインストールできた。(当方 Mac Book Pro)
今日は心底自分にあきれ果てた。ある問題に悩み始めたのが15時ごろで、終わったのが22時だから、7時間かかったことになる。その問題の解決方法が分かったときには正直自分を殺したくなった。本当は夕方から筋トレにいって、ごはん食べながらNetflix見て、ギター弾いてとかたくさんできたし、技術だけをやっていたとしても、7時間あったら、相当勉強できるしコードも書ける。そんな目にもうあいたくないので、今回の原因を分析して、メソッドに落とし込んでみた。 今回起こった問題の整理 私の解こうとした問題は簡単だった。というか過去にも似たような問題を解いたことがある。自分が今日は思ったように貢献できなかったら、今日一つぐらい貢献して帰ろうと思って、過去にやったことある問題をピックアップした。問題は単純で、.NET Core 3 のアプリをデプロイする ARM template とスクリプトを作成するというものだ
Feature Toggles Pete HodgsonさんというThoughtWorksの方が書かれたFeature Togglesという記事が面白かったので翻訳してみました。 「本番環境などという場所はない」マイクロソフトがSaaSの失敗と成功から学んだ、アジャイルからDevOpsへの進化(前編)。Regional SCRUM GATHERING Tokyo 2016の記事で取り上げていただいた通り、マイクロソフトの内部の開発では多くのフィーチャートグルが使われています。このことをより深く理解したいと思って個人的に翻訳したものを公開します。私的な自分が理解する用の翻訳でありますので、その辺はご考慮いただければと思います。Pull Requestは歓迎いたします! 概要 フィーチャートグルズ(Feature Toggles)は、とてもパワフルなテクニックだ。チームがコードを変更することな
自分のパーソナルプロジェクトで、go の CLI で、テンプレートから、プロジェクトをジェネレートする必要があったので、そこでの学びを整理しておく。Go のプロジェクトで、Yo のようにテンプレートジェネレートをしたい時、go のCLIならきっとシングルバイナリーで決めたいはず。その方法をシェアしたい。 戦略 CLI でテンプレートを作成するのは次のようなイメージ。 こうするといくつかのディレクトリとファイルが生成されるというわけ。この時に、テンプレートを作っておいて、hello-world というプロジェクトを作りたい時に、上記のようなコマンドを打つと、basic テンプレートに対して、hello-world というパッケージ名を埋めてディレクトリを生成してくれるというイメージ。よくありがちなもの。 実現方法として2つ思いついた。 テンプレートファイルを作っておいて、それをコードに変換す
Go で継承みたいなことをしたい時は Embedded のしくみを使える。ふわっとしかわかってないことに気づいたけど、リファレンスレベルだけど、自分用に整理しておく Embedding Embedded が使える種類 interface と struct に対して使える。 interface type Reader interface { Read(p []byte) (n int, err error) } type Writer interface { Write(p []byte)(n int, err error) type ReadWriter interface { Reader Writer }
Azure Storage Table のデータの書き出しを実施したかったので、どのように実施したかを記録しておきたい。 Azure SDK for Go Storage Table の操作に関しては、Storage Account 名前とキーがあれば可能になる。こちらにリファレンスが存在するのでどうやって使うかは想像がつきやすい。 storage 使用例と解説 使い方は簡単です。Storage Table のライブラリには、他のライブラリのように service/storage/mgmt の下に日付付きのライブラリが普通はあるのですが、なぜか Storage Table だけありません。 /services/storage/mgmt/2018-02-01/storage ルート直下にある /storage を読み込みます。その後は簡単で Storage Account clinet をイ
Go でコードを書いているが、Google に頼りすぎて嫌になって来たので、腰を落ち着けて、がっつり理解する事にした。やりたい事は外部コマンドの実行ではあるが、その前後に色々やりたいことがある。 外部コマンドが存在するか確認したい 外部コマンドを実行したい 外部コマンドに引き数は動的に設定したい 外部コマンドを実行中はインタラクティブに実行結果が表示されて欲しい 外部コマンドの成功失敗を取得したい 今回は、terraform のプロバイダを作ろうと思っているので、時間がかかる処理なので、実行中何も表示されないのは利用者としてきついと思うので、インタラクティブに実行結果が出て欲しい。作っているのはマルチプラットフォームで動作するCLIなので、Linux, Mac, Windows で動作して欲しい。 外部コマンドが存在するか確認したい 方法としては、コマンドを実行してみて、結果を見る方法。例
自分の作っているアプリで、レベル付きのログ出力をしたくなった。残念ながら、標準の log パッケージでは、レベルに対応していない。どのようにするべきか? 要件 Debug モードの時のみ詳細をダンプするようにしたい。 Debug モード以外の時は、余計な物を出して欲しくない コマンドラインアプリケーション という至ってシンプルなもの。出来るだけ公式の仕組みを使いたい。今回は、HashiCorp のlogutils を使ってみた。 hashicorp / logutils こちらは、基本的な仕組みはlog パッケージに乗っ取って最小の変更でレベルロギングを実現するというシンプルなもので、これでいい気がしてきた。しかも、terraform でも使っているので安心感があります。 環境変数の取得 最初にログレベルを取得するために、環境変数を取得する。 func Getenv これで一撃で環境変数が
Azure Service Broker は、Azure のマネードサービスをHelm からプロビジョンするための仕組みです。今日はこれの使い方を調べて見ました。 1. install Azure Service Broker で前提となっている、Service Calalog は残念ながら今の所 AKS では動かないらしく、ACS をデプロイする必要があります。 まずは、Azure / helm-charts をクローンしておきます。 1.1. Install Service Catalog まず、Service Catalog の手順を見ます。これは、Open Service Brokersと統合されていて、データベース、オブジェクトストレージ、メッセージキューなどをアプリケーションと関連付けをしながらプロビジョンしてくれるものみたいです。 ACS-engine / Releaseから
ちょっとした仕事で、ちゃんとした、 JavaScript のテストコードを書く必要性が生じた。動くテストはかけるが、あまり慣れていない言語で「適切な」テストコードがかけているかは正直わからない。まとまったラーニングコースを受けてみるつもりだが、2ビジネス営業日かかるみたいなので、まず最初に作ってみた。 テストフレームワークをどれを使うかはあたりがついている。Mochaとchai。これは、TypeScriptの頃から同じなので、馴染みがある。そもそもBDD形式のフレームワークなので、使い方はどれも似ている。 Mocha は BDDのテストフレームワークで、chai は, expect などのアサーション部分をBDDフレームワークの形式で書けるようになっている。インストールは次の通り
前の2つのエントリは、このエントリを調べたいための準備だったのです。 Javascript の yield と generator TypeScript の async/await を理解する その1 Promise やっと本編のasync / await について書くことができます。 Promise で非同期処理の順序性を保証してみる。 Promise によって、非同期処理の書きやすさが一段アップしましたが、async/wait の登場によってさらに素晴らしいものになりました。まずは、Promise で非同期のコード書いてみます。 function waitAndAnswer(message:string) : Promise<any> { console.log("Wait for 3 second."); return new Promise((resolve, reject) =>
Angular 4 で、マテリアルデザインを適用してアプリを作ろうと思ったんだけど、無茶苦茶にハマったので、ちゃんと動く手順をメモしておく。 ハマった方法 私は、Angular の初心者なので、何から始めたらいいのかわからず、本に書いてある通り、quick-start のリポジトリを元に、material design の npm を追加しました。すると、バージョン問題が発生するので、ちゃんとバージョンを合わせたり、ライブラリのバージョンが違うので、ディレクトリが違うため、systems.config.js にライブラリを追記したりと、色々やりましたが、ライブラリ取得時の404エラーは治ることなく、数時間格闘しましたが無理なので、寝ました。 うまくいく方法 しかし、問題は、「quick-start」を元にしているからであって、複雑なことを減らすとうまくいくようです。(特に初心者はいきなり
Docker で Jenkins 2.0 を動かすときのディスク権限、バックアップ/リストアに関するTipsJenkinsDocker Jenkins 2.0を動かすときのボリューム周りのTips を自分用のメモとして書いておきます。 課題 JenkinsのDockerイメージ、もしくはそれを継承したイメージを作成した場合、課題になるのが、ディスクの実行権限です。このイメージは、Dockerイメージの中で定義された、Jenkinsユーザ(uid 1000) で実行されるようになっています。 Dockerコンテナは、通常だとコンテナの内部にボリュームを持っていて、コンテナを削除すると、ボリュームは消えてしまいます。設定内容を保存したいケースでは、-vオプションを使って、保存したいディスク領域を、ホストOSのディスク領域にマウントする必要があります。 ただ、その場合、マウントした、ホストOS側
本記事では、瞬殺でApache Mesosの環境を簡単に試してみたい方のために、Apache Mesos + Chronos + Marathon + Dockerのクラスタを簡単にセットアップするための方法をご紹介いたします。 Apache Mesosとは Apache Mesosは、クラスタリソースマネージャであり、物理マシン(または仮想マシン)を1つのクラスタとして管理し、タスクを処理させたいときに、空いているマシンを探して、そこでリソースを割り当てて実行してくれるような仕組みです。この説明部分は正月休みだし Mesos 触ってみたという素晴らしい記事を参考にしています。すごくわかりやすい説明でした。 Marathonとは Apache Mesosでタスクを実行すると、どこかのサーバーでタスクを実行してくれるわけなのですが、タスクの実行をするのは一瞬です。これは、通常のOSでの挙動に
Startupプログラマの為の新アジャイルマニュフェスト(Kent Beck: beyond agile programming)agilelean はじめに Kent Beck氏がスタートアップのイベントに登壇し、素晴らしい講演をしたビデオを友人のタイムラインから見つけました。Startup Lessons Learnd: Kent Beck talks beyond agile programming アジャイルマニュフェストは10年が経過して、誰かの為にソフトウェアを作っていた時代から、スタートアップの時代に移行し、内容が一部古くなっていました。ところがこの講演でKentBeck氏は、それに対する素晴らしい回答をしてくれています。この内容が2010に行われているとは驚きです。 今回、このビデオを未熟なりにディクテーションして、適当ですが、日本語訳を作ってみました。本人に承認を取るつも
このドキュメントでは、Chefを実行して、インフラを作成したい人が、既存のレシピがあるのを前提に、Chefの概要を理解するためのドキュメントです。Chef-soloの構成のみに対応した記述になっています。理解が間違えているところとかあればご指摘ください。 1. Chefの概要 1.1. Chefとは シェフは、インフラストラクチャーをコードに変換するための自動化プラットフォームです。仮想環境でも、物理環境でも、クラウドでも使う事ができます。インフラストラクチャを自動化することで、プロダクトのマーケット投入を早めたり、スケールや複雑さに対応したり、システムを安全に保ちます。 1.2. Chefの仕組み Chefはサーバーをセットアップして、希望の状態にするための「クックブック」「ノードオブジェクト」というDSL(設定ファイルっぽいもの)をローカルのワークステーションで作成します。それらのDS
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く