Giter VIP home page Giter VIP logo

gcp-config's Introduction

gcp-config

Configs and tools for managing GCP configuration for M-Lab.

CBIF

CBIF adds conditional actions to Cloud Build configs (See cmd/cbif/DESIGN.md).

STCTL

STCTL manages storage transfer jobs, including declarative configurations.

CBCTL

CBCTL helps manage cloud build triggers in GCP.

gcp-config's People

Contributors

cristinaleonr avatar gfr10598 avatar nkinkade avatar pboothe avatar robertodauria avatar stephen-soltesz avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gcp-config's Issues

Create conditional runtime environment for gcp-config docker image

Currently, we've added runtime conditions to the stctl command for use during execution from Cloud Build. Instead, we want a runtime environment that interprets conditional directives like --execute_in_project=<foo> before calling exec on the remaining parameters passed to the docker image.

I imagine a new command cbenv or cbexec or cbopt or cbcond or similar, that accepts parameters from the environment and then execs the rest of argv if the conditions for execution are satisfied.

The first condition it should support is "EXECUTE_IN_PROJECTS=". With this directive it will be possible to have a single cloud build config with commands that should only be run in specific projects.

- name: gcp-config
  args: [ 'echo', 'hello world' ]
  env:
  - EXECUTE_IN_PROJECTS=mlab-sandbox,mlab-staging,mlab-oti

Additional ideas include conditional action on built-in environment variables -- https://cloud.google.com/cloud-build/docs/configuring-builds/substitute-variable-values For example, IF_TAG_SET, or IF_TAG_MATCHES=<pattern>.

Archive transfers taking too long

The daily archive transfers have been taking hours to run, such that the second transfer to archive-measurement-lab only has a fraction of the day's data.

Add cli support for multiple times/day

With the single time API, we can't tell whether we should disable existing transfers at different times.

By supporting multiple times in a single CLI call, we could then compare all existing jobs to see which ones should be updated, and which ones should be removed. This would work for changes in configs, times, or number of transfers per day.

Slack notifications for unsuccessful cloud builds

Cloud builds regular fail for transient reasons that we do not detect until much later because there is no notification mechanism for failed builds. This guide describes how to setup Slack notifications for Cloud builds.

Their examples filter on SUCCESS. But we could setup notifications for any non-SUCCESSful build, and send to the appropriate slack alert channel, #alerts-staging or #alerts-oti.

Available Build.Status enum values: https://cloud.google.com/build/docs/api/reference/rest/v1/projects.builds#Build.Status

Create `cbctl` that can run named Cloud Build triggers

Derived from comments on m-lab/siteinfo#100

I suggest that we create a new command, perhaps cbctl, with a subcommand "trigger" that accepts a trigger ID. This command should live in the gcp-config repo. My vision is to create a standard set of containers that will exist in our projects by default that we can just reference in the cloudbuild.yamls of other repos (like this one).

The other operations that cbctl would support is registering the trigger definitions for the standard workflow that we support between sandbox, staging, and prod using a uniform name, for a new (or existing) repo. Basically to remove the manual steps for creating build configs through GCP web console.

Make a new bucket with "US" location to replace archive-mlab-oti

The location for the archive-mlab-oti bucket in the mlab-oti project is "us-central1" (single region).

We want the bucket location to be "US" (multi-region) to allow for greater flexibility and for consistency with the corresponding buckets in mlab-sandbox and mlab-staging.

According to the documentation for GCS, it is not possible to change a bucket's location after it's created. We will have to create a new bucket with the location set to "US" and transfer the existing data to it.

Cloud Builds are broken in mlab-oti (daily-archive-transfers.yaml)

The build error is:

Step #1: 2021/02/08 18:30:06 Failed to sync (error: googleapi: Error 400: Service account storage-transfer-13271960596232968425@partnercontent.gserviceaccount.com does not have required permissions {storage.objects.list, storage.objects.delete} for bucket pusher-mlab-oti., failedPrecondition)
Step #1: 2021/02/08 18:30:06 error: pid:9 code:1 err:exit status 1
Finished Step #1
ERROR
ERROR: build step 1 "gcp-config-cbif" failed: step exited with non-zero status: 1

This looks rather like the service account or GCS bucket being used for this build in production is lacking some permissions that may have been manually configured in sandbox and staging (where builds are working). @stephen-soltesz noted that @gfr10598 had been making some changes to this repo which could possibly have affected this.

cbctl command creates unbounded regexp for branch names for triggers

@stephen-soltesz noticed that pushing to branch sandbox-soltesz-main-am was triggering Cloud Builds for prometheus-support in both mlab-sandbox and mlab-staging. Upon closer inspection, we noticed that the build trigger in mlab-staging had a value of "main" in the Build * field. The description for the Build * field states:

Trigger only for a branch that matches the given regular expression

The trigger was created using cbctl from this repository. The value of the Build * field should have been "^main$".

We need to update cbctl to create bounded regular expressions for matching on a branch name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.