Code Monkey home page Code Monkey logo

Comments (8)

menny avatar menny commented on June 16, 2024 1

reporting back that it works as expected now. Thank you.

from create-pull-request.

peter-evans avatar peter-evans commented on June 16, 2024

Any actions or workflows that rely on binaries in the GitHub Actions tool cache will have compatibility problems when run in Alpine Linux containers. The tool cache doesn't have separate binaries for Alpine so it will install linux platform binaries. For example, all the the official setup-* actions such as setup-python, setup-go, etc., install binaries from the tool cache. So those installed binaries very likely don't work in an Alpine Linux container.

I've made a small fix to the action and now it's possible to run inside an Alpine Linux container by pre-installing the correct binaries for the action's dependencies.

This is an example workflow that installs git and Python at the start of the job. You can also bake these dependencies into your own Alpine Docker image if you prefer that. Note that git must be installed before running actions/checkout, otherwise it will just download the source of the repository instead of cloning it.

(Outdated example workflow removed. See the latest documentation here.)

from create-pull-request.

peter-evans avatar peter-evans commented on June 16, 2024

Added to the documentation here: https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#using-in-an-alpine-linux-container

Thank you for raising this issue!

from create-pull-request.

menny avatar menny commented on June 16, 2024

I'm using a ubuntu container, and saw the same error.
I add to fake the container to look like Alpine (https://github.com/AnySoftKeyboard/AnySoftKeyboard/blob/master/.github/workflows/packs_md_update.yml#L19) to make this work.

from create-pull-request.

peter-evans avatar peter-evans commented on June 16, 2024

@menny Thanks for reporting your use case. I'm reopening this issue because clearly the action needs to be a bit more intelligent about whether or not to install Python from the GitHub Actions tool cache.

I notice the base image for your container is Ubuntu, so I'm a bit confused why the python and pip binaries from the tool cache don't run. Perhaps it's something to do with this line.

dpkg --add-architecture i386

from create-pull-request.

peter-evans avatar peter-evans commented on June 16, 2024

Actually, the problem in this case is that there is a missing shared library. On the hosted VMs, /usr/local/lib contains these shared libraries I think.

python: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
##[error]Process completed with exit code 127.

It may not be possible to use Python from the GitHub Actions tool cache when running in any container. I might just need to make it a requirement that if you run the action in a container you must pre-install Python and git.

from create-pull-request.

peter-evans avatar peter-evans commented on June 16, 2024

I've released a fix that detects if the action is running in a container and assumes python3 and pip3 are on the PATH. Documentation is updated here.

@menny This new fix now means that you don't need to fake running in alpine or create the symlinks. The base image of menny/ndk_ask:1.13.6 already installs Python 3 so it should just work.

from create-pull-request.

menny avatar menny commented on June 16, 2024

great! thanks!

I'll update my workflows.

from create-pull-request.

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.