Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jason Hall ImJasonH

🏠
Working from home
View GitHub Profile
@ImJasonH
ImJasonH / gcr-creds.yaml
Created Oct 2, 2020
GCR creds-updating Tekton sidecar
View gcr-creds.yaml
# Demonstrates a GCR creds-updating sidecar
# - The `creds-refresh` sidecar periodically fetches a Service Account auth
# token and uses it with `docker login` to authorize docker pushes to GCR.
# - The dind sidecar provides an ephemeral Docker daemon to run builds and
# store images before they're pushed.
# - The step periodically uses these credentials to push an image to GCR.
# $ kubectl create -f gcr-creds.yaml
# taskrun.tekton.dev/gcr-creds-9d7t7 created
View README.md

Testing GCE VM suspend/resume latency

time ./suspend-test.sh  &> output.txt

tl;dr

  • COS VM create takes ~10s
  • VM delete takes ~2m20s
@ImJasonH
ImJasonH / todos.md
Last active Jul 13, 2020
Custom Tasks TODOs
View todos.md
@ImJasonH
ImJasonH / README.md
Created Jun 24, 2020
Cloud Build custom task for Tekton
View README.md

Google Cloud Build for Tekton

Install

Install and configure ko.

ko apply -f cmd/cloudbuild/
View README.md

From within this directory:

KO_DOCKER_REPO=gcr.io/my-project go run ./
@ImJasonH
ImJasonH / git_resource.go
Created Jan 28, 2020
Sketch of change to migrate `git-init` to script mode (https://github.com/tektoncd/pipeline/issues/1961)
View git_resource.go
// GetInputTaskModifier returns the TaskModifier to be used when this resource is an input.
func (s *GitResource) GetInputTaskModifier(_ *TaskSpec, path string) (TaskModifier, error) {
return &InternalTaskModifier{
StepsToPrepend: []Step{{
Container: corev1.Container{
Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(gitSource + "-" + s.Name),
Image: s.GitImage,
WorkingDir: pipeline.WorkspaceDir,
// This is used to populate the ResourceResult status.
Env: []corev1.EnvVar{{
View go.mod
module example.com/foo/bar
go 1.13
View gist:e28498d52e8ee9ded05e92ce679a6d3a
gcloud
inputs:
* gcloud-image (default: foo)
* args (default: ["help"])
outputs:
* image (type: image)
You can’t perform that action at this time.