Skip to content

Conversation

@maelvls
Copy link
Member

@maelvls maelvls commented Feb 9, 2021

Closes #7.

I simply clone the GoogleCloudPlatform/ubbagent repo and built the image using the given ./Dockerfile in our cloudbuild.yml. The image is then pushed to:

# I use my own project, jetstack-mael-valais, for testing: 
gcr.io/jetstack-mael-valais/ubbagent:1.1.0

Since we just need the basic hourly reporting in the first iteration, I think it's OK not to fork it right away (no need to customize it at the moment).

@maelvls maelvls added this to the Beta milestone Feb 9, 2021
@maelvls maelvls changed the title Add the Google hourly billing agent "ubbagent" Build and push the hourly billing agent ubbagent Feb 10, 2021
@maelvls maelvls self-assigned this Feb 10, 2021
@maelvls maelvls requested a review from wallrj February 10, 2021 10:22
@maelvls maelvls modified the milestones: beta, initial-release Feb 11, 2021
Signed-off-by: Maël Valais <[email protected]>
Co-authored-by: Richard Wall <[email protected]>
Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments and questions, but please merge at will.

args:
- push
- gcr.io/$PROJECT_ID/${_SOLUTION_NAME}/ubbagent:${_CERT_MANAGER_VERSION}
waitFor: ["build-ubbagent"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered if these commands could all be executed in a single step, assuming that the gcr.io/cloud-builders/gcloud has the docker cli tools.
It might simplify the (already rather long) cloud-build.yaml.

But happy for this to be merged now, if you prefer it this way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And another question is whether we can pull / tag and push an existing image, rather than building from scratch?
Or even whether we need to pull and push this image, if by chance it is already hosted on the marketplace gcr registry.
These are just idle thoughts. Ignore them if you want to just get this merged.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, i would be happy to justn one single step instead of scattering in 3 different steps

Copy link
Member Author

@maelvls maelvls Feb 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And another question is whether we can pull / tag and push an existing image, rather than building from scratch?

I was unable to find a blessed image on gcr.io unfortunately, I searched everywhere but could not find anything :(

Copy link
Member Author

@maelvls maelvls Feb 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the gcloud doesnt have docker 😞

Step #12 - "build-ubbagent": + git clone https://github.com/GoogleCloudPlatform/ubbagent --branch 0.0.1
Step #12 - "build-ubbagent": + docker build --tag gcr.io/jetstack-mael-valais/cert-manager/ubbagent:1.1.0 ./ubbagent
Step #12 - "build-ubbagent": bash: line 1: docker: command not found

@maelvls maelvls force-pushed the add-ubbagent branch 2 times, most recently from ed64a6e to cc031c9 Compare February 11, 2021 17:23
Signed-off-by: Maël Valais <[email protected]>
Co-authored-by: Richard Wall <[email protected]>
@maelvls
Copy link
Member Author

maelvls commented Feb 11, 2021

Oops, some of my latest changes broke build-ubbagent

Step #15 - "build-deployer": mv: target 'chart' is not a directory
Step #15 - "build-deployer": The command '/bin/sh -c cd /tmp         && mv chart.tmp/* chart         && tar -czvf /tmp/chart.tar.gz chart         && mkdir -p /data/chart         && mv chart.tar.gz /data/chart/         && rm -Rf chart chart.tmp' returned a non-zero code: 1
Finished Step #15 - "build-deployer"
ERROR
ERROR: build step 15 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1

@maelvls
Copy link
Member Author

maelvls commented Feb 11, 2021

Fixed!

I had to move the preflight folder to the chart/jetstacksecure-mp/charts, that's what was causing the failure; the tar command expected a single folder but was receiving multiple ones 😅

/unassign
/assign @wallrj

@jetstack-bot jetstack-bot assigned wallrj and unassigned maelvls Feb 11, 2021
@maelvls maelvls requested a review from wallrj February 11, 2021 17:53
Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Thanks @maelvls

@jetstack-bot jetstack-bot merged commit 46c5293 into main Feb 11, 2021
@maelvls maelvls deleted the add-ubbagent branch November 3, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build and push the ubbagent image as part of cloudbuild.yml

4 participants