Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push, Pull, Build, Bop Images #20

Merged
merged 8 commits into from
Jul 29, 2024
Merged

Push, Pull, Build, Bop Images #20

merged 8 commits into from
Jul 29, 2024

Conversation

zjrgov
Copy link
Contributor

@zjrgov zjrgov commented Jul 25, 2024

The changes made to support the Kaniko service workflow are very moderate on the runner side, and mostly depend on the user doing some ugly stuff in their job. I figure we'll want to abstract some of this away for them at some point, but it probably makes more sense to do that after / during a rewrite (see #25 for details and a walkthrough of the script steps).

package image:
  stage: package
  image: cloudfoundry/cli:8.7.10
  services:
    - name: gcr.io/kaniko-project/executor:debug
      alias: kaniko
      entrypoint: ["/busybox/sh"]
  script:
    - cf api https://api.fr.cloud.gov
    - cf auth $CLOUD_GOV_USER $CLOUD_GOV_PASS
    - cf target -o gsa-tts-devtools-prototyping -s zjr-gl-test
    - tar -C $CI_PROJECT_DIR -czf bundle.tar.gz .
    - ci_auth=$(echo -n $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD | base64)
    - >-
      kaniko_cfg="{\"auths\": {\"${CI_REGISTRY}\": {\"auth\": \"${ci_auth}\"}}}"
    - >-
      echo $kaniko_cfg |
      cf ssh "${SERVICE_PREFIX}kaniko" --command
      "/busybox/cat > /kaniko/.docker/config.json"
    - >-
      cat bundle.tar.gz |
      cf ssh "${SERVICE_PREFIX}kaniko" --command
      "/kaniko/executor --context tar://stdin --destination=$APP_IMAGE_TAG"

Closes #16
Closes #17
Closes #21
Closes #22

@zjrgov zjrgov marked this pull request as ready for review July 29, 2024 16:53
@zjrgov zjrgov requested review from pauldoomgov and a team and removed request for pauldoomgov July 29, 2024 16:53
Copy link
Contributor

@pauldoomgov pauldoomgov left a comment

Choose a reason for hiding this comment

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

Good job getting this over the line!

@@ -27,16 +28,55 @@ create_temporary_varfile () {
echo "[cf-driver] [DEBUG] Added $(wc -l "$TMPVARFILE") lines to $TMPVARFILE"
}

get_registry_credentials () {
Copy link
Contributor

@pauldoomgov pauldoomgov Jul 29, 2024

Choose a reason for hiding this comment

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

praise: Painful but pragmatic! (Which is probably the rightful title of a Bash book.)

@@ -12,6 +12,7 @@ trap 'rm -f "$TMPVARFILE"' EXIT
currentDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source "${currentDir}/base.sh" # Get variables from base.
if [ -z "${WORKER_MEMORY-}" ]; then
# Some jobs may fail with less than 512M, e.g., `npm i`
Copy link
Contributor

@pauldoomgov pauldoomgov Jul 29, 2024

Choose a reason for hiding this comment

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

thought: The default is arbitrary - Worth adjusting if we find it is too little in many more cases.

@zjrgov zjrgov force-pushed the zjr/push-pull-imgs branch from 174ad83 to 3f2a7e3 Compare July 29, 2024 21:36
@zjrgov zjrgov merged commit bcbd100 into main Jul 29, 2024
@zjrgov zjrgov deleted the zjr/push-pull-imgs branch July 29, 2024 21:37
@zjrgov zjrgov assigned zjrgov and unassigned zjrgov Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants