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

Job fails when using quay.io/condaforge/linux-anvil-cos7-x86_64 image #1220

Closed
sgaist opened this issue May 14, 2024 · 8 comments · Fixed by #1223
Closed

Job fails when using quay.io/condaforge/linux-anvil-cos7-x86_64 image #1220

sgaist opened this issue May 14, 2024 · 8 comments · Fixed by #1223

Comments

@sgaist
Copy link

sgaist commented May 14, 2024

Minimal .gitlab-ci.yml illustrating the issue

---
job:
  image: quay.io/condaforge/linux-anvil-cos7-x86_64
  script:
    - echo "Heya"
    - ls -la
    - python3 hello.py

hello.py:

print("Hello world")

Expected behavior

job copied to docker volumes in 3.38 s
job $ echo "Heya"
job > Heya
job $ ls -la
job > total 16
job > drwxrwxrwx 3 root root 4096 May 14 15:21 .
job > drwxr-xr-x 1 root root 4096 May 14 15:22 ..
job > drwxrwxrwx 7 root root 4096 May 14 15:11 .git
job > -rw-rw-rw- 1 root root   21 May 14 15:13 test.py
job $ python3 test.py
job > Hello world
job finished in 13 s

Actual behavior

job copied to docker volumes in 3.88 s
job > bash: cannot set terminal process group (-1): Inappropriate ioctl for device
job > bash: no job control in this shell
job $ echo "Heya"
job > Heya
job $ ls -la
job > total 24
job > drwx------ 2 conda conda 4096 May 14 15:17 .
job > drwxr-xr-x 1 root  root  4096 May 14 15:17 ..
job > -rw-r--r-- 1 conda conda   18 Nov 24  2021 .bash_logout
job > -rw-r--r-- 1 conda conda  193 Nov 24  2021 .bash_profile
job > -rw-r--r-- 1 conda conda  231 Nov 24  2021 .bashrc
job > -rw-r--r-- 1 conda conda   75 May 14 15:17 .condarc
job $ python3 test.py
job > python3: can't open file '/home/conda/hello.py': [Errno 2] No such file or directory
job finished in 7.83 s  FAIL 2

Host information
KDE Neon
gitlab-ci-local 4.46.1

macOS 13.6.6
gitlab-ci-local 4.49.00

Containerd binary
macOS Docker Desktop with Docker version 24.0.7-rd, build 72ffacf

Linux Docker version 26.1.2, build 211e74b

Additional context
The "faulty" image can be used successfully with GitLab with the docker runner.
The "Expected behaviour" run uses python:3.12-slim-bookworm for the image.

Both images can be run using docker directly.

@ANGkeith
Copy link
Collaborator

hmm, a wild guess

https://github.com/firecow/gitlab-ci-local?tab=readme-ov-file#tracked-files

will ^ fix the issue

@firecow
Copy link
Owner

firecow commented May 15, 2024

What @ANGkeith said 👍
Feel free to reopen, if git add isn't your issue.

@firecow firecow closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
@sgaist
Copy link
Author

sgaist commented May 16, 2024

Sadly it's something different.

The original issue was detected with an already existing repository where all required files were added.
To ensure I did not miss something for the reproducer, I did a commit with all the files before starting gitlab-ci-local.

@sgaist
Copy link
Author

sgaist commented May 16, 2024

@firecow AFAIK, I cannot reopen the issue myself since I did not close it and I am not a collaborator on the project.

@ANGkeith ANGkeith reopened this May 16, 2024
@ANGkeith ANGkeith added elaborate Further elaboration is needed and removed elaborate Further elaboration is needed labels May 16, 2024
@ANGkeith
Copy link
Collaborator

ANGkeith commented May 16, 2024

Cool managed to replicate it

The "Expected behaviour" run uses python:3.12-slim-bookworm for the image.

my bad i missed this message of yours

seemed like this bug is caused by the entrypoint of the image changing the cwd

As a tempfix:

---
job:
  image: quay.io/condaforge/linux-anvil-cos7-x86_64
  script:
    - cd $CI_PROJECT_DIR # <============
    - echo "Heya"
    - ls -la
    - python3 hello.py

@firecow
Copy link
Owner

firecow commented May 16, 2024

How does Gitlab manage to handle this CI_PROJECT_DIR swith-a-roo?

@ANGkeith
Copy link
Collaborator

ANGkeith commented May 16, 2024

without digging into the source code,

i suspect its doing the same thing under the hood

image

ANGkeith added a commit that referenced this issue May 16, 2024
- fixes #1220 whereas docker entrypoint changes the cwd
ANGkeith added a commit that referenced this issue May 16, 2024
- fixes #1220 whereas docker entrypoint changes the cwd
firecow pushed a commit that referenced this issue May 16, 2024
- fixes #1220 whereas docker entrypoint changes the cwd
@sgaist
Copy link
Author

sgaist commented May 17, 2024

Thanks !

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 a pull request may close this issue.

3 participants