Open oilrich25 opened 10 months ago
Today I discovered through debugging the gitlab-tart-executor
project that CI_BUILDS_DIR
is located at:
export CI_BUILDS_DIR=$\'/private/tmp/builds\
Instead of /Volumes/My Shared Files/hostdir
as you mentioned before. The actual build directory found in the tart container is in $\'/private/tmp/builds\
, please see the screenshot
@ChristopherHX You can combine the files I posted above to correspond to the ENV
variable in cirruslabs/gitlab-tart-executor
, and you should be able to continue.
Today I discovered through debugging the
gitlab-tart-executor
project thatCI_BUILDS_DIR
is located at:export CI_BUILDS_DIR=$\'/private/tmp/builds\
Instead of
/Volumes/My Shared Files/hostdir
as you mentioned before
This is only the case if the build dir is not mounted
If you mount build dir it changes.
However https://tart.run/quick-start/ mentiones changing the mount location, so yes we could get rid of spaces even for mounted folders.
Both runner.server
/gitea-actions-runner
don't need a shared filesystem, only a shared network.
act
integrations need a shared filesystem or something like docker cp.
This project (runner.server
) is capable to run a custom script together with information about the started job.
https://github.com/ChristopherHX/runner.server#onqueuejob like labels.
gitlab-tart-executor
could also be used as a cli tool for that script.
gitlab-tart-executor prepare
)./config.sh
script on the VM to register the VM to runner.server (--ephemeral
, causes exit after the first job finished) (gitlab-tart-executor run somescript.sh
)./run.sh
script and wait for exitgitlab-tart-executor cleanup
)I'm currently quite busy with my assignments for my university
Today I discovered through debugging the
gitlab-tart-executor
project thatCI_BUILDS_DIR
is located at:export CI_BUILDS_DIR=$\'/private/tmp/builds\
Instead of
/Volumes/My Shared Files/hostdir
as you mentioned beforeThis is only the case if the build dir is not mounted
If you mount build dir it changes.
However https://tart.run/quick-start/ mentiones changing the mount location, so yes we could get rid of spaces even for mounted folders.
Both
runner.server
/gitea-actions-runner
don't need a shared filesystem, only a shared network.
act
integrations need a shared filesystem or something like docker cp.This project (
runner.server
) is capable to run a custom script together with information about the started job. https://github.com/ChristopherHX/runner.server#onqueuejob like labels.
gitlab-tart-executor
could also be used as a cli tool for that script.
- start vm using image of the labels array of the json (
gitlab-tart-executor prepare
)- Run the
./config.sh
script on the VM to register the VM to runner.server (--ephemeral
, causes exit after the first job finished) (gitlab-tart-executor run somescript.sh
)- Run the
./run.sh
script and wait for exit- Stop (
gitlab-tart-executor cleanup
)I'm currently quite busy with my assignments for my university
oilrich25deMac-mini:Desktop oilrich25$ CUSTOM_ENV_CI_JOB_ID=10 CUSTOM_ENV_CI_JOB_IMAGE="macos-ventura-base" /opt/homebrew/bin/gitlab-tart-executor config -h
Configure GitLab Runner
Usage:
executor config [flags]
Flags:
--builds-dir string Path to a directory on host to use for storing builds
--cache-dir string path to a directory on host to use for caching purposes
-h, --help help for config
oilrich25deMac-mini:Desktop oilrich25$ CUSTOM_ENV_CI_JOB_ID=10 CUSTOM_ENV_CI_JOB_IMAGE="macos-ventura-base" /opt/homebrew/bin/gitlab-tart-executor config
{
"builds_dir": "/private/tmp/builds",
"cache_dir": "/private/tmp/cache"
}
What you mean above is that runner.server
directly integrates cirruslabs/gitlab-tart-executor
to execute the tart container to build the project, right? I think it's also a good note. After all, I successfully restored the below. Use cirruslabs/gitlab-tart-executor
to execute the tart container, then build and finally destroy the tart container. But the premise is that the parameters required by prepare_script
, get_sources
, and build_script
need to be constructed.
By the way, no matter which command in cirruslabs/gitlab-tart-executor
is executed, the two environment variables CUSTOM_ENV_CI_JOB_ID
and CUSTOM_ENV_CI_JOB_IMAGE
must be brought in front
oilrich25deMac-mini:Desktop oilrich25$ tart list
Source Name Size State
local macos-ventura-base 20 stopped
oilrich25deMac-mini:Desktop oilrich25$ CUSTOM_ENV_CI_JOB_ID=10 CUSTOM_ENV_CI_JOB_IMAGE="macos-ventura-base" /opt/homebrew/bin/gitlab-tart-executor prepare
2023/12/10 12:35:20 Pulling the latest version of macos-ventura-base...
2023/12/10 12:35:20 Cloning and configuring a new VM...
2023/12/10 12:35:20 Waiting for the VM to boot and be SSH-able...
2023/12/10 12:35:29 Was able to SSH!
2023/12/10 12:35:29 VM is ready.
oilrich25deMac-mini:Desktop oilrich25$
oilrich25deMac-mini:Desktop oilrich25$ tart list
Source Name Size State
local gitlab-10 20 running // CUSTOM_ENV_CI_JOB_ID=10 , Created by `cirruslabs/gitlab-tart-executor` through prepare method
local macos-ventura-base 20 stopped
oilrich25deMac-mini:Desktop oilrich25$
oilrich25deMac-mini:Desktop oilrich25$ CUSTOM_ENV_CI_JOB_ID=10 CUSTOM_ENV_CI_JOB_IMAGE="macos-ventura-base" /opt/homebrew/bin/gitlab-tart-executor run custom-executor786579228/script2110979536/script. prepare_script
Running on admins-Virtual-Machine.local...
oilrich25deMac-mini:Desktop oilrich25$
oilrich25deMac-mini:Desktop oilrich25$ CUSTOM_ENV_CI_JOB_ID=10 CUSTOM_ENV_CI_JOB_IMAGE="macos-ventura-base" /opt/homebrew/bin/gitlab-tart-executor run custom-executor786579228/script741168682/script. get_sources
Fetching changes with git depth set to 20...
Initialized empty Git repository in /private/tmp/builds/oilrich25/actions-demo/.git/
Created fresh repository.
fatal: couldn't find remote ref refs/pipelines/5
2023/12/10 12:36:39 Process exited with status 128
oilrich25deMac-mini:Desktop oilrich25$
oilrich25deMac-mini:Desktop oilrich25$ CUSTOM_ENV_CI_JOB_ID=10 CUSTOM_ENV_CI_JOB_IMAGE="macos-ventura-base" /opt/homebrew/bin/gitlab-tart-executor run custom-executor786579228/script1968687583/script. build_script
$ uname -a
Darwin admins-Virtual-Machine.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:19 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_VMAPPLE arm64
$ pwd
/private/tmp/builds/oilrich25/actions-demo
oilrich25deMac-mini:Desktop oilrich25$
oilrich25deMac-mini:Desktop oilrich25$ CUSTOM_ENV_CI_JOB_ID=10 CUSTOM_ENV_CI_JOB_IMAGE="macos-ventura-base" /opt/homebrew/bin/gitlab-tart-executor cleanup
oilrich25deMac-mini:Desktop oilrich25$
oilrich25deMac-mini:Desktop oilrich25$ tart list
Source Name Size State
local macos-ventura-base 20 stopped
oilrich25deMac-mini:Desktop oilrich25$
Both runner.server/gitea-actions-runner don't need a shared filesystem, only a shared network.
I also agree that runner.server/gitea-actions-runner
is easier to integrate. And I pretty much use runner.server/gitea-actions-runner
currently, not act
. 😀
If it is a shared file system, it has been tested by me. The following method was found to be feasible.
oilrich25deMac-mini:Desktop oilrich25$ tart list
Source Name Size State
local macos-ventura-base 20 stopped
oilrich25deMac-mini:Desktop oilrich25$ tart clone macos-ventura-base vm
oilrich25deMac-mini:Desktop oilrich25$ tart run --dir=_work:/Users/oilrich25/Desktop/gitea-actions-runner/actions-runner/_work vm
It is recommended to make a soft link ln -s /Volumes/My\ Shared\ Files/_work /private/tmp/_work
oilrich25deMac-mini:Desktop oilrich25$ sshpass -p admin ssh -o "StrictHostKeyChecking no" admin@$(tart ip vm) "ln -s /Volumes/My\ Shared\ Files/_work /private/tmp/_work"
oilrich25deMac-mini:Desktop oilrich25$ sshpass -p admin ssh -o "StrictHostKeyChecking no" admin@$(tart ip vm) "cd /private/tmp/_work/simple-go-action/simple-go-action/"
oilrich25deMac-mini:Desktop oilrich25$ sshpass -p admin ssh -o "StrictHostKeyChecking no" admin@$(tart ip vm) "cd /private/tmp/_work/simple-go-action/simple-go-action/ && pwd"
/private/tmp/_work/simple-go-action/simple-go-action
oilrich25deMac-mini:Desktop oilrich25$ sshpass -p admin ssh -o "StrictHostKeyChecking no" admin@$(tart ip vm) "cd /private/tmp/_work/simple-go-action/simple-go-action/ && ls"
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE.txt
README.md
build-image.sh
image
shell.sh
oilrich25deMac-mini:Desktop oilrich25$ sshpass -p admin ssh -o "StrictHostKeyChecking no" admin@$(tart ip vm) "cd /private/tmp/_work/simple-go-action/simple-go-action/ && ./shell.sh"
/private/tmp/_work/simple-go-action/simple-go-action
Thanks to @ChristopherHX for adding the
tart
pkg foract
https://github.com/nektos/act/issues/2105#issuecomment-1839449499. But since @ChristopherHX does not have M1 or M2 hardware on hand, he may have some doubts about some internal parameters ofgitlab-tart-executor
. In order to help @ChristopherHX complete this task, I specially setgitlab-tart-executor
I did
Debugparameter tracking during the execution of
tartcontainer, hoping to give @ChristopherHX some help. Secondly, I think it is more reasonable to integrate
tartinto
ChristopherHX/runner.server. Because I saw @ChristopherHX added
Windows ContainerDocker container support to
ChristopherHX/runner.server, so
ChristopherHX/runner.servercan currently run
Linux Containerand
Windows Container, If
ChristopherHX/runner.serveralso integrates
tart, it means that
ChristopherHX/runner.server` can completely execute and build our code on the three major platforms through a complete isolation space.custom-executor786579228.tar.gz output.txt
# script2110979536/script. // prepare_script
# script741168682/script. // get_sources
# script1968687583/script. // build_script