oracle / oracle/macaron

Macaron docker breaks in CI with default entry point

Open
#342 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

integration
Dominant language
Python
Stars
210
Forks
36
Avg merge
1d 10h
Merged PRs (30d)
2

Description

Compare L21

Executing "step_script" stage of the job script
00:00
Using docker image sha256:e90e8ba0[18](https://gitlab.com/committed-consulting/mde-devops/macaron-example/-/jobs/4555123889#L18)ae4bbbc6cfcde6518561bce7aa040[19](https://gitlab.com/committed-consulting/mde-devops/macaron-example/-/jobs/4555123889#L19)a05df976b9a28217f64321c for ghcr.io/oracle/macaron:latest with digest ghcr.io/oracle/macaron@sha256:5e1c888e45d14f5b1d396f493b457e88a4385aaf09c39a0edf92754f06b8983c ...
Cannot find the GID and UID of the host machine's user. The output files generated could not be modifiable from the host machine.
Consider providing the GID and UID via the env variables USER_GID and USER_UID respectively.
bash: -c: line 1: syntax error near unexpected token `then'
bash: -c: line 1: `cd /home/macaron && . .venv/bin/activate && sh -c if [ -x /usr/local/bin/bash ]; then'

Seems this is due to a broken expansion of ${MACARON_PARAMS[*]}.

COMMAND="cd /home/macaron && . .venv/bin/activate && ${MACARON_PARAMS[*]}"

It is this issue

And this from the doco:

The runner expects that the image has no entrypoint or that the entrypoint is prepared to start a shell command.
(Emphasis me)

The following works in Gitlab ci, but is not pretty. Note that you will need to set the GITHUB_TOKEN in the environment variables of the run.

run_macaron:
    stage: build
    image:
      name: ghcr.io/oracle/macaron:latest
      entrypoint: [""]
    script:
      - /bin/bash /home/macaron/user.sh macaron analyze -rp https://github.com/micronaut-projects/micronaut-core -b 4.0.x -d 82d115b4901d10226552ac67b0a10978cd5bc603

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with docker/user.sh around line 47 and compare the linked GitLab CI failure with the documented entrypoint behavior. Reproduce the default-entrypoint invocation in GitLab CI, then verify that the command is passed to the shell without the syntax error and that the explicit entrypoint override remains unnecessary.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, docker
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.