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

Do not build container actions ahead of time #814

Open
umarcor opened this issue Nov 19, 2020 · 3 comments
Open

Do not build container actions ahead of time #814

umarcor opened this issue Nov 19, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request Runner Feature Feature scope to the runner

Comments

@umarcor
Copy link

umarcor commented Nov 19, 2020

jobs:

  job:
    runs-on: ubuntu-latest
    steps:
    
    # BUG: GitHub's runner tries to build the last action before starting the first step.
    # It fails, because container image image_name does not exist yet.
    
    - name: Build hdlc/doc
      run: |
        docker build -t image_name - <<-EOF
        FROM asciidoctor/docker-asciidoctor
        RUN apk add -U --no-cache graphviz
        EOF
        
    - uses: actions/checkout@v2

    - uses: docker://image_name
      with:
        args: doc/make.sh

As a result, it is currently not possible to use local containers using the uses: docker:// syntax.

The alternative is to call docker explicitly, which requires handling all the environment manually (if necessary):

jobs:

  job:
    runs-on: ubuntu-latest
    steps:

    - name: Build hdlc/doc
      run: |
        docker build -t image_name - <<-EOF
        FROM asciidoctor/docker-asciidoctor
        RUN apk add -U --no-cache graphviz
        EOF

    - uses: actions/checkout@v2

    - name: Build site
      run: docker run -v /$(pwd)://documents/ image_name ./doc/make.sh

Using local docker images in container steps should be supported too.

@umarcor umarcor added the bug Something isn't working label Nov 19, 2020
@umarcor
Copy link
Author

umarcor commented Nov 12, 2021

/cc @thboop, per #646 (comment)

This issue applies to composite actions as well. Find a reproducer in https://github.com/hdl/containers/blob/GHA-MWEs/utils/mwe-local-container-image/action.yml and https://github.com/hdl/containers/blob/GHA-MWEs/.github/workflows/MWE-814.yml. That workflow contains the two jobs in the code blocks above, plus a job using a composite action. Example execution: https://github.com/hdl/containers/actions/runs/1451481784

@umarcor
Copy link
Author

umarcor commented Dec 18, 2021

Ref: community/community#9053

@ruvceskistefan ruvceskistefan added the Runner Bug Bug fix scope to the runner label Mar 30, 2022
@nikola-jokic nikola-jokic self-assigned this Apr 4, 2022
@nikola-jokic
Copy link
Contributor

Hi @umarcor,

We pre-fetch stuff related to the uses directive, but I will label this as an enhancement and it will be considered for a change in the future. It is also on our backlog and we will update you on the progress when we pick it up ☺️

@nikola-jokic nikola-jokic added enhancement New feature or request Runner Feature Feature scope to the runner and removed bug Something isn't working Runner Bug Bug fix scope to the runner labels Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Runner Feature Feature scope to the runner
Projects
None yet
Development

No branches or pull requests

3 participants