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

Doesn't work on custom containers ubuntu18:04 #71

Closed
ghost opened this issue Nov 25, 2022 · 15 comments
Closed

Doesn't work on custom containers ubuntu18:04 #71

ghost opened this issue Nov 25, 2022 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Nov 25, 2022

Hello,
I'm unable to make this project working when using a custom container.
Here is an example yaml file:

name: Build

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    container: ubuntu:18.04
    steps:
    - name: Install packages
      uses: awalsh128/cache-apt-pkgs-action@latest
      with:
        packages: ca-certificates build-essential
        version: 1.0

And here is the error:

Run awalsh128/cache-apt-pkgs-action@latest
  with:
    packages: ca-certificates build-essential
    version: 1
    refresh: false
Run /home/runner/work/_actions/awalsh128/cache-apt-pkgs-action/latest/pre_cache_action.sh \
  /home/runner/work/_actions/awalsh128/cache-apt-pkgs-action/latest/pre_cache_action.sh \
    ~/cache-apt-pkgs \
    "1" \
    ca-certificates build-essential
  echo "CACHE_KEY=$(cat ~/cache-apt-pkgs/cache_key.md5)" >> $GITHUB_ENV
  shell: bash --noprofile --norc -e -o pipefail {0}
/__w/_temp/4a9fd062-d58a-4c3d-ab50-128748bc2e9c.sh: line 2: /home/runner/work/_actions/awalsh128/cache-apt-pkgs-action/latest/pre_cache_action.sh: No such file or directory
Error: Process completed with exit code 127.

Could you help me in making it work with a custom container?
Thank you.

@ghost ghost assigned awalsh128 Nov 25, 2022
@awalsh128
Copy link
Owner

Does this work on another configuration? Also, can you try with an older release?

@ghost
Copy link
Author

ghost commented Nov 28, 2022

Thank you for your reply.
What do you mean by "other configuration"? I'll try with an older release.

@ghost
Copy link
Author

ghost commented Nov 28, 2022

I've tried with 1.0.1 but same issue.

@awalsh128
Copy link
Owner

Can you share your workflow file and the full log as well? Also, can you tell me more about this custom container setup?

@ghost
Copy link
Author

ghost commented Nov 30, 2022

Thank you for the reply.

Unfortunately I can't disclose the rest of the workflow file, but I made a test repository here: https://github.com/emiliencartesoft/test-apt-cache/actions

As you can see the full logs are here: https://github.com/emiliencartesoft/test-apt-cache/actions/runs/3581373128/jobs/6024358104

@ghost
Copy link
Author

ghost commented Nov 30, 2022

Found the issue, in https://github.com/awalsh128/cache-apt-pkgs-action/blob/master/action.yml ${{ github.action_path }} doesn't point to the correct path in a custom container. See actions/runner#716

Changing from ${{ github.action_path }} to ${GITHUB_ACTION_PATH} solves the issue.

awalsh128 added a commit that referenced this issue Nov 30, 2022
Workaround for #71. Due to a bug in the runner  actions/runner#716
@awalsh128
Copy link
Owner

Nice find. I updated the dev branch with the workaround so you can use that as @dev. From the history I am not confident they will commit the fix soon (although it looks close to resolution). I may just issue a patch for this. Thoughts?

@ghost
Copy link
Author

ghost commented Nov 30, 2022

Well it works with the example packages (ca-certificates build-essential) and when sudo curl wget are installed too.

I did test with other packages like python3-pip awscli but that didn't work for some unknown reasons: https://github.com/emiliencartesoft/test-apt-cache/actions/runs/3581841036/jobs/6025366907

Anyway with the commit 343fbfd it works in custom containers, at least when sudo curl wget packages are installed.

@awalsh128
Copy link
Owner

Sorry for the lag here.

RE: Action path - Looks like this was mentioned before.
RE: Container specific - There was a mention where the container needed to be run as priveleged

Let me know if the situation changes make the container option modification.

@ghost
Copy link
Author

ghost commented Dec 7, 2022

Well for me the changes in the commit 343fbfd should be merged into the master branch because it fixes the issue with custom containers.

@awalsh128
Copy link
Owner

awalsh128 commented Dec 7, 2022

I agree. I am going to put in that change as well and issue a patch tonight. I meant the container specific one but I think I misunderstood and this solved it completely for you.

@awalsh128 awalsh128 added the bug Something isn't working label Dec 8, 2022
@awalsh128
Copy link
Owner

Issued a patch update in v1.2.1. Let me know how it works and I will rev up the tag aliases for general use (i.e. latest).

awalsh128 added a commit that referenced this issue Dec 28, 2022
* Workaround for #71. Due to a bug in the runner  actions/runner#716 (#75)

* docs: fix link to actions/cache (#77)

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
@awalsh128
Copy link
Owner

Going to assume this worked and close out this issue since it has been awhile.

@joaoantoniocardoso
Copy link

joaoantoniocardoso commented May 17, 2024

Sorry, but it doesn't seem to be working. Here's an example:

name: Test webrtc thread leak

on: [push, pull_request]

jobs:
  test-webrtc-thread-leak:
    runs-on: ubuntu-22.04
    container: ubuntu:24.04
    env:
      DEBIAN_FRONTEND: noninteractive

    steps:
    - name: Install build dependencies
      uses: awalsh128/cache-apt-pkgs-action@v1
      with:
        packages: libunwind-dev

    - name: Checkout
      uses: actions/checkout@v4

output:

Run awalsh128/cache-apt-pkgs-action@v1
  with:
    packages: libunwind-dev
    execute_install_scripts: false
    debug: false
  env:
    DEBIAN_FRONTEND: noninteractive
Run ${GITHUB_ACTION_PATH}/pre_cache_action.sh \
  ${GITHUB_ACTION_PATH}/pre_cache_action.sh \
    ~/cache-apt-pkgs \
    "$VERSION" \
    "$EXEC_INSTALL_SCRIPTS" \
    "$DEBUG" \
    "$PACKAGES"
  echo "CACHE_KEY=$(cat ~/cache-apt-pkgs/cache_key.md5)" >> $GITHUB_ENV
  shell: bash --noprofile --norc -e -o pipefail {0}
  env:
    DEBIAN_FRONTEND: noninteractive
    VERSION: 
    EXEC_INSTALL_SCRIPTS: false
    DEBUG: false
    PACKAGES: libunwind-dev
22:06:54.398 Normalizing package list...
22:06:54.426 done
22:06:54.428 Validating action arguments (version='', packages='')...
22:06:54.430 aborted
22:06:54.431 Packages argument cannot be empty.
Error: Process completed with exit code 3.

@joaoantoniocardoso
Copy link

My bad, my problem was another thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants