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

Dont install broken docker-compose on ARM #100

Merged
merged 2 commits into from
Mar 23, 2021
Merged

Conversation

myoung34
Copy link
Owner

Resolves #99

@myoung34 myoung34 force-pushed the docker_compose_arm branch from df52b29 to d74f910 Compare March 23, 2021 10:51
@mrmachine
Copy link

It's good to have the limitation noted and a link to the workaround, thanks.

But it'd be better if we could install the run.sh shim instead, and note the caveat that users must export COMPOSE_OPTIONS='-e FOO -e BAR to pass through environment variables from their shell to compose?

@myoung34
Copy link
Owner Author

myoung34 commented Mar 23, 2021

If you'd like to add documentation to this after I merge about COMPOSE_OPTIONS I'd be happy to accept it, but I don't use docker-compose enough to be able to articulate that limitation.

I'll add the ability to use run.sh as a command override but I won't change it to that by default. I updated the PR to reflect the ability to override it with a docker command directive and default to /actions-runner/bin/runsvc.sh

See the updated PR

@myoung34 myoung34 merged commit 48446fa into master Mar 23, 2021
@myoung34 myoung34 deleted the docker_compose_arm branch March 23, 2021 12:42
@syrinscape-admin
Copy link

@myoung34 I do not think the override as implemented will achieve anything in terms of the docker-compose run.sh shim. The shim needs to be installed at /usr/local/bin/docker-compose so that when the runner executes a workflow that runs compose, the shim is executed and compose is run in a container. You have allowed overriding the runner command.

Sure, I might now be able to bind mount and execute my own command wrapper now instead of an entrypoint wrapper, but it's still the same amount of work (create wrapper, bind mount it, configure a different entrypoint/cmd).

But I think it's best to wrap the entrypoint anyway so I can alter the runner name and work dir with a persistent unique ID, but that's more related to scaling than using compose in a workflow.

@myoung34
Copy link
Owner Author

its more related to scaling using docker-compose

If youd like to add a PR for a new flag that will cause a random work dir that would be acceptable on my side.

For the entrypoint: I wont alter the entrypoint outside of allowing a dynamic command though.

Your best bet is to set up automation that will do

FROM myoung34/github-runner:latest
COPY myentrypoint.sh /
RUN chmod +x /myentrypoint.sh

where myentrypoint.sh is something like

#!/usr/bin/dumb-init /bin/bash
if [[ ! -f /tmp/github-actions/runner_id.txt ]]; then
    head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 > /tmp/github-actions/runner_id.txt
fi
_RUNNER_ID="$(cat /tmp/github-actions/runner_id.txt)"
RUNNER_NAME="${RUNNER_NAME}-${_RUNNER_ID}"
RUNNER_WORKDIR="${RUNNER_WORKDIR}/${_RUNNER_ID}"

exec /entrypoint.sh run.sh

If you build that nightly it would work fairly seamlessly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker-compose not available in arm image.
3 participants