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

xu-cheng/latex-action@v3 calls docker and volumes aren't properly mapped #2382

Open
virzak opened this issue Jul 1, 2024 · 2 comments
Open
Labels
kind/bug Something isn't working

Comments

@virzak
Copy link

virzak commented Jul 1, 2024

Bug report info

act version:            0.2.64
GOOS:                   windows
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        \\.\pipe\docker_engine(broken)
Config files:
        C:\Users\virzak\AppData\Local\act\actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
                -P windows-latest=-self-hosted
                --artifact-server-path C:/TMP/artifacts
                --use-new-action-cache
                --env ACTIONS_CACHE_URL=http://127.0.0.1:8080/
                --env ACTIONS_RUNTIME_URL=http://127.0.0.1:8080/
                --env ACTIONS_RUNTIME_TOKEN=token
                --env ACT_CACHE_AUTH_KEY=token
Build info:
        Go version:            go1.21.11
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.64 -X main.commit=aa54ea933591a57d1179c2691a57f2017aa855e5 -X main.date=2024-07-01T02:21:46Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 windows
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         aa54ea933591a57d1179c2691a57f2017aa855e5
                vcs.time:             2024-07-01T02:21:27Z
                vcs.modified:         false
Docker Engine:
        Engine version:        5.1.1
        Engine runtime:        crun
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlay
        Registry URI:
        OS:                    fedora
        OS type:               linux
        OS version:            40
        OS arch:               amd64
        OS kernel:             5.15.153.1-microsoft-standard-WSL2
        OS CPU:                16
        OS memory:             30982 MB
        Security options:
                name=seccomp,profile=default
                name=rootless

Command used with act

act

Describe issue

An action calls docker inside its script. That results in a situation where there is a host, act container and action container.
https://github.com/xu-cheng/latex-action/blob/1ccd8e9a1ba76e30b547a1baf0e9c6d5ca33aea3/action.sh#L56

It also maps volumes from the act container to the action container, which is apparently impossible.

Is there a common solution to these types of actions?

Link to GitHub repository

https://github.com/george-lim/resume

Workflow content

name: CI

on:
  push:
    branches: main
  pull_request:
    branches: main
  workflow_dispatch:

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: xu-cheng/latex-action@v3
        with:
          root_file: resume.tex
      - uses: actions/upload-artifact@v4
        with:
          name: Resume
          path: resume.pdf

Relevant log output

https://pastebin.com/Cq0p2ptu

Additional information

No response

@virzak virzak added the kind/bug Something isn't working label Jul 1, 2024
@ChristopherHX
Copy link
Contributor

Technically for act you could try

  • open wsl with docker desktop integration / ubuntu virtual machine with docker engine (required for non linux systems)
    • maybe you could use the docker dind image instead of a vm / wsl
  • switch to the linux shell
  • then tell act to not spawn a container e.g. -P ubuntu-latest=-self-hosted (yes I added it some years ago)
  • Look at the result, didn't do this myself

At some point I would ask you, is act the right tool for your usecase?
Do you know that actions/runner can be executed like act locally? I have written such a tool (just because I'm able to do it), because act didn't fit my needs for an exact GitHub Actions Clone
A windows host can complicate things if you want to emulate a true linux system, applies for all scenarios wether you use act or not.

@virzak
Copy link
Author

virzak commented Jul 2, 2024

Thanks for your response.

At some point I would ask you, is act the right tool for your usecase?

I was wondering how a case of docker being called from inside the action could be handled. The question was more of a theoretical one; I don't have any urgent need for this. I can also drop to xu-cheng/latex-action@v2 which does work with act.

And it does work on my ubuntu machine with -P ubuntu-latest=-self-hosted

One Idea that I had was to let act know variables like GITHUB_STEP_SUMMARY should point to the host /mnt/something.... That way when an action script calls docker, these variables would be passed down like GITHUB_WORKSPACE gets passed down.
https://github.com/xu-cheng/latex-action/blob/1ccd8e9a1ba76e30b547a1baf0e9c6d5ca33aea3/action.sh#L127-L132

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

No branches or pull requests

2 participants