GithubHelp home page GithubHelp logo

Comments (3)

benjlevesque avatar benjlevesque commented on June 9, 2024 1

I'm having the same issue, and I solved it using a custom image, inspired from CircleCI-Public

FROM circleci/python:3.7

ARG GCLOUD_VERSION=268.0.0

# Downloading gcloud package
RUN cd ~

# Downloading gcloud package
RUN curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_VERSION}-linux-x86_64.tar.gz > /tmp/google-cloud-sdk.tar.gz

# Installing the package
RUN sudo mkdir -p /usr/local/gcloud 
RUN sudo tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz
RUN sudo /usr/local/gcloud/google-cloud-sdk/install.sh

# Adding the package path to local
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin

This works well for the orbs' commands, but I believe to use the orbs' job, but it's not suitable for the orb's jobs, as far as I know (you can't specify an executor or docker image when using the job direclty in the workflow, can you?)

I feel the orbs should offer a way to execute the job with a docker image that already has the tools installed...

from gcp-gcr-orb.

KyleTryon avatar KyleTryon commented on June 9, 2024

Hello all, as described in your initial post, the orb will only install the GCP CLI if it is not found within the execution environment. Installing is an option but if the image provided to the job has the GCP CLI installed that will be the fastest solution.

While CircleCI does not yet supply any docker images with the GCP CLI installed, we do intend to release a suite of deployment images in the future.

Currently, it would be recommended to build a custom docker image using our next-generation base image as the base for your docker image. Simply install the GCP CLI and build and that should shave quite a bit of time assuming you hit the cache for the base image (which is growing daily).
https://circleci.com/docs/2.0/circleci-images/#circleci-base-image

@benjlevesque provided a great example, the new base image is newer than this post.

For any suggestions to the platform directly (rather than an orb) please feel free to open a new idea or vote for an existing one on our ideas portal: https://ideas.circleci.com/ideas

Thank you.

from gcp-gcr-orb.

benjlevesque avatar benjlevesque commented on June 9, 2024

Hey @KyleTryon I've sent a PR to fix the part I mentioned regarding jobs and executors.

This enables to have a very short and use the build-and-push-image job, while enjoying the optimizations of a custom image.

from gcp-gcr-orb.

Related Issues (20)

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.