canonical / charmed-kubeflow-workflows

Repository that containes GitHub workflows and shareable configs for Charmed Kubeflow
0 stars 0 forks source link

Create action that copies ROCK to Docker #29

Open orfeas-k opened 9 months ago

orfeas-k commented 9 months ago

What needs to get done

Create an action to copy ROCK to Docker. We could create a composite action (which is essentially just a workflow file).

Why it needs to get done

At the moment, these lines of code are copied-pasted over a lot of our workflows

build_and_publish_rock.yaml
build_and_scan_rock.yaml
build_scan_and_test_rock.yaml

In order to avoid copy-pasting and reuse this inside a workflow's step, we need to create an action for it.

You call a reusable workflow by using the uses keyword. Unlike when you are using actions within a workflow, you call reusable workflows directly within a job, and not from within job steps.

(source)

syncronize-issues-to-jira[bot] commented 9 months ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-5129.

This message was autogenerated

orfeas-k commented 9 months ago

We still need this after https://github.com/canonical/charmed-kubeflow-workflows/pull/36, since we 're doing the following in all WFs introduced there (scan-rock.yaml, sanity-test.yaml, integration-test.yaml, publish-rock.yaml)

          DOCKER_IMAGE=${{ inputs.rock-name }}:${{ inputs.rock-version }}
          sudo skopeo --insecure-policy copy oci-archive:${{ inputs.rock-filename }} docker-daemon:$DOCKER_IMAGE
          echo "image=$DOCKER_IMAGE" >> "$GITHUB_OUTPUT"

This could also be coupled with the download-artifact action and be a Download and export ROCK to Docker action

orfeas-k commented 5 months ago

As @NohaIhab pointed out here, we could omit skopeo as a dependency and use the skopeo bin provided when installing rockcraft, as it is used here.