cml: `cml ` on cml runner instance fails
I have tried a few iterations of this:
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: iterative/setup-cml@v1
- name: deploy runner
env:
GOOGLE_APPLICATION_CREDENTIALS_DATA: ${{ secrets.GCP_CML_RUNNER_KEY }}
run: |
cml runner \
--single \
--labels=test \
--token=${{ secrets.DACBD_PAT }} \
--cloud=gcp \
--cloud-region=us-west \
--cloud-type=e2-highcpu-2
test:
needs: [setup]
runs-on: [self-hosted, test]
steps:
- uses: actions/checkout@v2
- run: |
which cml
cml ci
Fails with an odd message: Error: Cannot find module '/tmp/tmp.njlS8oR0sf/.cml/cml-ehsjbxeja3/_work/cml-pulse/cml-pulse/ci'
and:
...
test:
needs: [setup]
runs-on: [self-hosted, test]
steps:
- uses: actions/checkout@v2
- uses: iterative/setup-cml@v1
- run: |
which cml
cml ci
Fails with a EEXIST: file already exists, symlink '../lib/node_modules/@dvcorg/cml/bin/cml.js' -> '/usr/bin/cml'
However using --cml-version=github:iterative/cml.git#master \
to trigger the npm install -g
way of setting up cml on the runner instance works fine.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 16 (16 by maintainers)
👀 🤔
I think what I have in mind shouldn’t care (if it works); as far as I have seen there is no issue with repeated invocations, just the “re-invocation” within the inherited context of the first
pkg
cml runner
call which is the “parent” process of github actions runner and thus subsequent use of thecml
cmdFinished doing some reading and plan to try it out tomorrow evening 😴
While “libelous” I feel validated with suspicion of child_process/spawn weirdness, also well done on the hunt! (https://github.com/vercel/pkg/issues/897#issuecomment-1076988215) I glanced at that chunk but, I missed the value of this in my initial grep of the codebase after I had found the culprit env.
To summarize, I agree I think the fix is solving #802 which I have an idea for beyond what is currently implemented in that branch which I intend to test out soon.
🤣 /edit that was the one strikethrough I missed, I have not revisited the rabbit hole I dug trying to find the root of the issue
Does it set the env? In my basic docker reproduction running a
cml
command did not seem to set that ENV? … Though…I suspect you are correct that #802 would fix this.
Playing around more it seems it only fails if
PKG_EXECPATH
is set the actual executablewith Dockerfile:
Which installs cml the same as tpi,
so if
PKG_EXECPATH
is set to the exactpkg
binary cml will failAll the mentions to
node-pseudoexec
are, at least, libellous. 😄 Fortunately, this error doesn’t seem to have anything to do with the command plugin feature from #703.When you (1) run
cml runner --cloud=gcp
it creates a cloud instance and (2) runscml runner
inside, which, in turn, (3) executes the GitHub Actions runner in charge of (4) running the workflow that (5) callscml ci
in the example above.The
cml
standalone binary (#842 & https://github.com/iterative/terraform-provider-iterative/pull/255) used for (2) is apkg
binary. As such, it sets thePKG_EXECPATH
environment variable that propagates to all the child processes up to (5).I don’t understand yet why setting
PKG_EXECPATH
causes binaries bundled withpkg
to fail, but this can be mitigated by unsetting this variable before calling the GitHub runner process; see #802 for a stale draft.