Orb version
gcp-gcr: circleci/[email protected]
Although I have slightly modified the job from this orb in order to load the workspace for docker build. So I based my job on build-and-push-image and has the following steps:
steps:
- checkout
- gcp-gcr/gcr-auth:
google-project-id: <<parameters.google-project-id>>
google-compute-zone: <<parameters.google-compute-zone>>
gcloud-service-key: <<parameters.gcloud-service-key>>
- attach_workspace:
at: /tmp/workspace
- gcp-gcr/build-image:
registry-url: <<parameters.registry-url>>
google-project-id: <<parameters.google-project-id>>
image: <<parameters.image>>
tag: << parameters.tag >>
extra_build_args: <<parameters.docker-build-args>>
- gcp-gcr/push-image:
registry-url: <<parameters.registry-url>>
google-project-id: <<parameters.google-project-id>>
image: <<parameters.image>>
tag: <<parameters.tag>>
What happened
So we use this rebranded job in all our repos but find consistently across them all that using the machine executor, it takes 50+ seconds to run the installation of gcloud. This is caused by the gcp-gcr/gcr-auth
step which seems to invoke install from the gcp-cli orb.
I get the reason here is that I'm using a machine executor, but I can't seem to find any from circle that includes the gcloud-cli already. That would cut out 50+ seconds from our CI.
For reference below is an example where its actually quicker to build the docker image than it is to have gcloud installed.
I haven't tried remote docker as I would probably need to mount the workspace to the remote docker for the build to work, but would doing that and using a docker executor be one way of having gcloud cli pre-installed?
Expected behavior
Ideally I want to not install gcloud and save 50+ seconds of time.
But the only way I can see that happening is if there are some circleci machines or docker images with gcloud already installed. Is that the case with the default executor for this module?
I don't think I can use a docker executor as the build-image
command would then need to point to a remote docker instance to work?
Is this unique to us, or do other people see this step taking a long time?