「抽象的な観点から言えば、デプロイメント パイプラインとは、ソフトウェアをバージョン管理の段階からユーザーの手に渡すまでのプロセスを自動的に表現したものです」 ― Jez Humble 氏の著書『Continuous Delivery : Reliable Software Releases through Build, Test, and Deployment Automation』(継続的デリバリ : ビルド、テスト、デプロイの自動化で実現する信頼性の高いソフトウェア リリース)より
gcloud beta compute instance-groups managed rolling-action start-update my-instance-group --version template=myapp-version-b
gcloud beta compute instance-groups managed rolling-action start-update my-instance-group --version template=myapp-version-a
gcloud beta compute instance-groups managed rolling-action start-update my-instance-group --version template=myapp-version-b --max-unavailable 25%
gcloud beta compute instance-groups managed rolling-action start-update my-instance-group --version template=myapp-version-a --canary-version template=myapp-version-b,target-size=1
gcloud beta compute instance-groups managed rolling-action start-update my-instance-group --version template=myapp-version-a --canary-version template=myapp-version-b,target-size=50%
gcloud beta compute instance-groups managed rolling-action replace my-instance-group --max-unavailable=10%
「ログ ベースの指標を使えば、複数のプロキシにわたって発生するエラーを監視できるほか、エラーの発生時点に基づいて頻度を視覚化できます。これにより、以前のバージョンでは発生しなかった不具合や設定ミスであることを特定できるのです。」
gcloud beta logging sinks create my-bq-sink bigquery.googleapis.com/projects/my-project/datasets/my_dataset --log-filter='logName= "logs/cloudaudit.googleapis.com%2Factivity"' --organization=1234 --include-children
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { // Initialize Stackdriver Logging loggerFactory.AddGoogle("YOUR-GOOGLE-PROJECT-ID"); ... } public void LogMessage(ILoggerFactory loggerFactory) { // Send a log to Stackdriver Logging var logger = loggerFactory.CreateLogger("NetworkLog"); logger.LogInformation("This is a log message."); }
public void ConfigureServices(IServiceCollection services) { services.AddGoogleExceptionLogging(options => { options.ProjectId = "YOUR-GOOGLE-PROJECT-ID"; options.ServiceName = "ImageGenerator"; options.Version = "1.0.2"; }); ... } public void Configure(IApplicationBuilder app) { // Use before handling any requests to ensure all unhandled exceptions are reported. app.UseGoogleExceptionLogging(); ... }
public void ReadFile(IExceptionLogger exceptionLogger) { try { string scores = File.ReadAllText(@"C:\Scores.txt"); Console.WriteLine(scores); } catch (IOException e) { exceptionLogger.Log(e); } }
public void ConfigureServices(IServiceCollection services) { string projectId = "YOUR-GOOGLE-PROJECT-ID"; services.AddGoogleTrace(options => { options.ProjectId = projectId; }); ... } public void Configure(IApplicationBuilder app) { // Use at the start of the request pipeline to ensure the entire request is traced. app.UseGoogleTrace(); ... }
public void TraceHelloWorld(IManagedTracer tracer) { using (tracer.StartSpan(nameof(TraceHelloWorld))) { Console.Out.WriteLine("Hello, World!"); } }
gauth_credential { 'mycred': provider => serviceaccount, path => '/home/nelsona/my_account.json', scopes => ['https://www.googleapis.com/auth/cloud-platform'], } gcontainer_cluster { 'myapp-netes': ensure => present, initial_node_count => 2, node_config => { machine_type => 'n1-standard-4', # we want a 4-core machine for our cluster disk_size_gb => 500, # ... and a lot of disk space }, zone => 'us-central1-f', project => 'google.com:graphite-playground', credential => 'mycred', }
$ puppet apply <<EOF package { [ 'googleauth', 'google-api-client', ]: ensure =< present, provider =< gem, } EOF
puppet module install google/cloud
puppet module install google/gcompute # Google Compute Engine puppet module install google/gcontainer # Google Container Engine puppet module install google/gdns # Google Cloud DNS puppet module install google/gsql # Google Cloud SQL puppet module install google/gstorage # Google Cloud Storage
puppet module list
$ puppet module list /home/nelsona/.puppetlabs/etc/code/modules ├── google-cloud (v0.1.0) ├── google-gauth (v0.1.0) ├── google-gcompute (v0.1.0) ├── google-gcontainer (v0.1.0) ├── google-gdns (v0.1.0) ├── google-gsql (v0.1.0) └── google-gstorage (v0.1.0) /opt/puppetlabs/puppet/modules (no modules installed)
'mycred'
credential
gauth_credential { 'mycred': provider => serviceaccount, path => '/home/nelsona/my_account.json', scopes => ['https://www.googleapis.com/auth/cloud-platform'], }
gcontainer_cluster { 'myapp-netes': ensure => present, initial_node_count => 2, node_config => { machine_type => 'n1-standard-4', # we want a 4-core machine for our cluster disk_size_gb => 500, # ... and a lot of disk space }, project => 'google.com:graphite-playground', credential => 'mycred', }
puppet apply <your-file.pp>
puppet apply
$ google-cloud-gemserver create --use-proj [MY_PROJECT_ID]
$ gem install google-cloud-gemserver
$ gem push --key my-key-name [PATH_TO_MY_GEM] --host \ > http://[MY_PROJECT_ID].appspot.com/private/
my-key
source “[GEMSERVER_URL]” source “[GEMSERVER_URL]/private” do gem “MY_GEM” end
bundle install