From 064c8ff77aa6353fa7723963cef00abdcc9230c4 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Tue, 25 Mar 2025 23:24:19 -0400 Subject: [PATCH 1/7] add volume mount for nix Signed-off-by: ahuston-0 --- .github/workflows/flake-health-checks.yml | 18 ++-- systems/palatine-hill/docker/act-runner.nix | 7 +- systems/palatine-hill/docker/act_config.yaml | 97 ++++++++++++++++++++ 3 files changed, 111 insertions(+), 11 deletions(-) create mode 100644 systems/palatine-hill/docker/act_config.yaml diff --git a/.github/workflows/flake-health-checks.yml b/.github/workflows/flake-health-checks.yml index c0cea76..b576e2a 100644 --- a/.github/workflows/flake-health-checks.yml +++ b/.github/workflows/flake-health-checks.yml @@ -8,10 +8,11 @@ on: jobs: health-check: name: "Perform Nix flake checks" - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] + runs-on: ubuntu-latest + container: + image: ubuntu:latest + volumes: + - "/nix:/nix" steps: - uses: DeterminateSystems/nix-installer-action@main - name: Setup Attic cache @@ -26,10 +27,11 @@ jobs: - run: nix ./utils/attic-push.bash build-checks: name: "Build nix outputs" - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] + runs-on: ubuntu-latest + container: + image: ubuntu:latest + volumes: + - "/nix:/nix" steps: - uses: DeterminateSystems/nix-installer-action@main - name: Setup Attic cache diff --git a/systems/palatine-hill/docker/act-runner.nix b/systems/palatine-hill/docker/act-runner.nix index 29e439e..97db4fa 100644 --- a/systems/palatine-hill/docker/act-runner.nix +++ b/systems/palatine-hill/docker/act-runner.nix @@ -6,6 +6,7 @@ let vars = import ../vars.nix; act_path = vars.primary_act; + act_config_path = ./act_config.yaml; in { virtualisation.oci-containers.containers = { @@ -20,7 +21,7 @@ in }; ports = [ "8088:8088" ]; volumes = [ - "${act_path}/stable-latest-main/config.yaml:/config.yaml" + "${act_config_path}:/config.yaml" "${act_path}/stable-latest-main/data:/data" "/var/run/docker.sock:/var/run/docker.sock" "/nix:/nix" @@ -43,7 +44,7 @@ in "com.centurylinklabs.watchtower.scope" = "act-runner"; }; volumes = [ - "${act_path}/stable-latest-1/config.yaml:/config.yaml" + "${./act_config.yaml}:/config.yaml" "${act_path}/stable-latest-1/data:/data" "/var/run/docker.sock:/var/run/docker.sock" "/nix:/nix" @@ -66,7 +67,7 @@ in "com.centurylinklabs.watchtower.scope" = "act-runner"; }; volumes = [ - "${act_path}/stable-latest-2/config.yaml:/config.yaml" + "${act_config_path}:/config.yaml" "${act_path}/stable-latest-2/data:/data" "/var/run/docker.sock:/var/run/docker.sock" "/nix:/nix" diff --git a/systems/palatine-hill/docker/act_config.yaml b/systems/palatine-hill/docker/act_config.yaml new file mode 100644 index 0000000..0c950a7 --- /dev/null +++ b/systems/palatine-hill/docker/act_config.yaml @@ -0,0 +1,97 @@ +# Example configuration file, it's safe to copy this as the default config file without any modification. + +# You don't have to copy this file to your instance, +# just run `./act_runner generate-config > config.yaml` to generate a config file. +log: + # The level of logging, can be trace, debug, info, warn, error, fatal + level: info +runner: + # Where to store the registration result. + file: .runner + # Execute how many tasks concurrently at the same time. + capacity: 1 + # Extra environment variables to run jobs. + envs: + A_TEST_ENV_NAME_1: a_test_env_value_1 + A_TEST_ENV_NAME_2: a_test_env_value_2 + # Extra environment variables to run jobs from a file. + # It will be ignored if it's empty or the file doesn't exist. + env_file: .env + # The timeout for a job to be finished. + # Please note that the Gitea instance also has a timeout (3h by default) for the job. + # So the job could be stopped by the Gitea instance if it's timeout is shorter than this. + timeout: 3h + # The timeout for the runner to wait for running jobs to finish when shutting down. + # Any running jobs that haven't finished after this timeout will be cancelled. + shutdown_timeout: 0s + # Whether skip verifying the TLS certificate of the Gitea instance. + insecure: false + # The timeout for fetching the job from the Gitea instance. + fetch_timeout: 5s + # The interval for fetching the job from the Gitea instance. + fetch_interval: 2s + # The labels of a runner are used to determine which jobs the runner can run, and how to run them. + # Like: "macos-arm64:host" or "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest" + # Find more images provided by Gitea at https://gitea.com/gitea/runner-images . + # If it's empty when registering, it will ask for inputting labels. + # If it's empty when execute `daemon`, will use labels in `.runner` file. + labels: + - "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest" + - "ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04" + - "ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04" + #cache: + # Enable cache server to use actions/cache. + #enabled: true + # The directory to store the cache data. + # If it's empty, the cache data will be stored in $HOME/.cache/actcache. + #dir: "" + # The host of the cache server. + # It's not for the address to listen, but the address to connect from job containers. + # So 0.0.0.0 is a bad choice, leave it empty to detect automatically. + #host: "" + # The port of the cache server. + # 0 means to use a random available port. + #port: 0 + # The external cache server URL. Valid only when enable is true. + # If it's specified, act_runner will use this URL as the ACTIONS_CACHE_URL rather than start a server by itself. + # The URL should generally end with "/". + #external_server: "" +container: + # Specifies the network to which the container will connect. + # Could be host, bridge or the name of a custom network. + # If it's empty, act_runner will create a network automatically. + network: "" + # Whether to use privileged mode or not when launching task containers (privileged mode is required for Docker-in-Docker). + privileged: false + # And other options to be used when the container is started (eg, --add-host=my.gitea.url:host-gateway). + options: + # The parent directory of a job's working directory. + # NOTE: There is no need to add the first '/' of the path as act_runner will add it automatically. + # If the path starts with '/', the '/' will be trimmed. + # For example, if the parent directory is /path/to/my/dir, workdir_parent should be path/to/my/dir + # If it's empty, /workspace will be used. + workdir_parent: + # Volumes (including bind mounts) can be mounted to containers. Glob syntax is supported, see https://github.com/gobwas/glob + # You can specify multiple volumes. If the sequence is empty, no volumes can be mounted. + # For example, if you only allow containers to mount the `data` volume and all the json files in `/src`, you should change the config to: + # valid_volumes: + # - data + # - /src/*.json + # If you want to allow any volume, please use the following configuration: + # valid_volumes: + # - '**' + valid_volumes: + - /nix + # overrides the docker client host with the specified one. + # If it's empty, act_runner will find an available docker host automatically. + # If it's "-", act_runner will find an available docker host automatically, but the docker host won't be mounted to the job containers and service containers. + # If it's not empty or "-", the specified docker host will be used. An error will be returned if it doesn't work. + docker_host: "" + # Pull docker image(s) even if already present + force_pull: true + # Rebuild docker image(s) even if already present + force_rebuild: false +host: + # The parent directory of a job's working directory. + # If it's empty, $HOME/.cache/act/ will be used. + workdir_parent: -- 2.48.1 From 4cc29cc662ebc7024d4d48f07df277197b8ae3e7 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Tue, 25 Mar 2025 23:34:01 -0400 Subject: [PATCH 2/7] move to dind images --- systems/palatine-hill/docker/act-runner.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/systems/palatine-hill/docker/act-runner.nix b/systems/palatine-hill/docker/act-runner.nix index 97db4fa..d9f211c 100644 --- a/systems/palatine-hill/docker/act-runner.nix +++ b/systems/palatine-hill/docker/act-runner.nix @@ -11,7 +11,7 @@ in { virtualisation.oci-containers.containers = { act-stable-latest-main = { - image = "gitea/act_runner:latest"; + image = "gitea/act_runner:latest-dind-rootless"; extraOptions = [ "--stop-signal=SIGINT" ]; @@ -35,7 +35,7 @@ in }; act-stable-latest-1 = { - image = "gitea/act_runner:latest"; + image = "gitea/act_runner:latest-dind-rootless"; extraOptions = [ "--stop-signal=SIGINT" ]; @@ -58,7 +58,7 @@ in }; act-stable-latest-2 = { - image = "gitea/act_runner:latest"; + image = "gitea/act_runner:latest-dind-rootless"; extraOptions = [ "--stop-signal=SIGINT" ]; -- 2.48.1 From 3d97fc743ca134dd9c9347f84c2ea9bc8891a466 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Tue, 25 Mar 2025 23:37:36 -0400 Subject: [PATCH 3/7] update runner labels --- systems/palatine-hill/docker/act_config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/systems/palatine-hill/docker/act_config.yaml b/systems/palatine-hill/docker/act_config.yaml index 0c950a7..5e255af 100644 --- a/systems/palatine-hill/docker/act_config.yaml +++ b/systems/palatine-hill/docker/act_config.yaml @@ -36,9 +36,9 @@ runner: # If it's empty when registering, it will ask for inputting labels. # If it's empty when execute `daemon`, will use labels in `.runner` file. labels: - - "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest" - - "ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04" - - "ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04" + - "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest-full" + - "ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04-full" + - "ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04-full" #cache: # Enable cache server to use actions/cache. #enabled: true -- 2.48.1 From bc710058da68b591212ba5055a07571ef0a0933a Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Tue, 25 Mar 2025 23:41:15 -0400 Subject: [PATCH 4/7] revert dind rootless --- systems/palatine-hill/docker/act-runner.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/systems/palatine-hill/docker/act-runner.nix b/systems/palatine-hill/docker/act-runner.nix index d9f211c..97db4fa 100644 --- a/systems/palatine-hill/docker/act-runner.nix +++ b/systems/palatine-hill/docker/act-runner.nix @@ -11,7 +11,7 @@ in { virtualisation.oci-containers.containers = { act-stable-latest-main = { - image = "gitea/act_runner:latest-dind-rootless"; + image = "gitea/act_runner:latest"; extraOptions = [ "--stop-signal=SIGINT" ]; @@ -35,7 +35,7 @@ in }; act-stable-latest-1 = { - image = "gitea/act_runner:latest-dind-rootless"; + image = "gitea/act_runner:latest"; extraOptions = [ "--stop-signal=SIGINT" ]; @@ -58,7 +58,7 @@ in }; act-stable-latest-2 = { - image = "gitea/act_runner:latest-dind-rootless"; + image = "gitea/act_runner:latest"; extraOptions = [ "--stop-signal=SIGINT" ]; -- 2.48.1 From 2b10fdd2cf3d942efcc2bbd5ca40db5f68de4b97 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Tue, 25 Mar 2025 23:43:46 -0400 Subject: [PATCH 5/7] disable bcg-plus Signed-off-by: ahuston-0 --- systems/palatine-hill/docker/act_config.yaml | 1 - systems/palatine-hill/docker/minecraft.nix | 74 ++++++++++---------- 2 files changed, 37 insertions(+), 38 deletions(-) diff --git a/systems/palatine-hill/docker/act_config.yaml b/systems/palatine-hill/docker/act_config.yaml index 5e255af..f66fa4c 100644 --- a/systems/palatine-hill/docker/act_config.yaml +++ b/systems/palatine-hill/docker/act_config.yaml @@ -1,5 +1,4 @@ # Example configuration file, it's safe to copy this as the default config file without any modification. - # You don't have to copy this file to your instance, # just run `./act_runner generate-config > config.yaml` to generate a config file. log: diff --git a/systems/palatine-hill/docker/minecraft.nix b/systems/palatine-hill/docker/minecraft.nix index 141fbe0..37fae2b 100644 --- a/systems/palatine-hill/docker/minecraft.nix +++ b/systems/palatine-hill/docker/minecraft.nix @@ -9,31 +9,31 @@ let divinejourney = "dj.alicehuston.xyz"; rlcraft = "rlcraft.alicehuston.xyz"; arcanum-institute = "arcanum.alicehuston.xyz"; - bcg-plus = "bcg.alicehuston.xyz"; + # bcg-plus = "bcg.alicehuston.xyz"; }; defaultServer = "rlcraft"; - defaultEnv = { - EULA = "true"; - TYPE = "AUTO_CURSEFORGE"; - STOP_SERVER_ANNOUNCE_DELAY = "120"; - STOP_DURATION = "600"; - SYNC_CHUNK_WRITES = "false"; - USE_AIKAR_FLAGS = "true"; - MEMORY = "8GB"; - ALLOW_FLIGHT = "true"; - MAX_TICK_TIME = "-1"; - }; + # defaultEnv = { + # EULA = "true"; + # TYPE = "AUTO_CURSEFORGE"; + # STOP_SERVER_ANNOUNCE_DELAY = "120"; + # STOP_DURATION = "600"; + # SYNC_CHUNK_WRITES = "false"; + # USE_AIKAR_FLAGS = "true"; + # MEMORY = "8GB"; + # ALLOW_FLIGHT = "true"; + # MAX_TICK_TIME = "-1"; + # }; - defaultOptions = [ - "--stop-signal=SIGTERM" - "--stop-timeout=1800" - "--network=minecraft-net" - ]; + # defaultOptions = [ + # "--stop-signal=SIGTERM" + # "--stop-timeout=1800" + # "--network=minecraft-net" + # ]; - vars = import ../vars.nix; - minecraft_path = "${vars.primary_games}/minecraft"; + # vars = import ../vars.nix; + # minecraft_path = "${vars.primary_games}/minecraft"; in { virtualisation.oci-containers.containers = { @@ -67,24 +67,24 @@ in # log-driver = "local"; # environmentFiles = [ config.sops.secrets."docker/minecraft".path ]; # }; - bcg-plus = { - image = "itzg/minecraft-server:java17"; - volumes = [ - "${minecraft_path}/bcg-plus/modpacks:/modpacks:ro" - "${minecraft_path}/bcg-plus/data:/data" - ]; - hostname = "bcg-plus"; - environment = defaultEnv // { - VERSION = "1.17"; - CF_SLUG = "bcg"; - DIFFICULTY = "normal"; - DEBUG = "true"; - # ENABLE_COMMAND_BLOCK = "true"; - }; - extraOptions = defaultOptions; - log-driver = "local"; - environmentFiles = [ config.sops.secrets."docker/minecraft".path ]; - }; + # bcg-plus = { + # image = "itzg/minecraft-server:java17"; + # volumes = [ + # "${minecraft_path}/bcg-plus/modpacks:/modpacks:ro" + # "${minecraft_path}/bcg-plus/data:/data" + # ]; + # hostname = "bcg-plus"; + # environment = defaultEnv // { + # VERSION = "1.17"; + # CF_SLUG = "bcg"; + # DIFFICULTY = "normal"; + # DEBUG = "true"; + # # ENABLE_COMMAND_BLOCK = "true"; + # }; + # extraOptions = defaultOptions; + # log-driver = "local"; + # environmentFiles = [ config.sops.secrets."docker/minecraft".path ]; + # }; }; sops = { -- 2.48.1 From d70903a84f5f5c931c4d1e6bf83d1d9a5ca7bee6 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Wed, 26 Mar 2025 00:28:23 -0400 Subject: [PATCH 6/7] revert volume changes Signed-off-by: ahuston-0 --- .github/workflows/flake-health-checks.yml | 8 -------- systems/palatine-hill/docker/act-runner.nix | 3 --- systems/palatine-hill/docker/act_config.yaml | 3 +-- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/flake-health-checks.yml b/.github/workflows/flake-health-checks.yml index b576e2a..c8a5bd8 100644 --- a/.github/workflows/flake-health-checks.yml +++ b/.github/workflows/flake-health-checks.yml @@ -9,10 +9,6 @@ jobs: health-check: name: "Perform Nix flake checks" runs-on: ubuntu-latest - container: - image: ubuntu:latest - volumes: - - "/nix:/nix" steps: - uses: DeterminateSystems/nix-installer-action@main - name: Setup Attic cache @@ -28,10 +24,6 @@ jobs: build-checks: name: "Build nix outputs" runs-on: ubuntu-latest - container: - image: ubuntu:latest - volumes: - - "/nix:/nix" steps: - uses: DeterminateSystems/nix-installer-action@main - name: Setup Attic cache diff --git a/systems/palatine-hill/docker/act-runner.nix b/systems/palatine-hill/docker/act-runner.nix index 97db4fa..dc7fcfd 100644 --- a/systems/palatine-hill/docker/act-runner.nix +++ b/systems/palatine-hill/docker/act-runner.nix @@ -24,7 +24,6 @@ in "${act_config_path}:/config.yaml" "${act_path}/stable-latest-main/data:/data" "/var/run/docker.sock:/var/run/docker.sock" - "/nix:/nix" ]; environment = { CONFIG_FILE = "/config.yaml"; @@ -47,7 +46,6 @@ in "${./act_config.yaml}:/config.yaml" "${act_path}/stable-latest-1/data:/data" "/var/run/docker.sock:/var/run/docker.sock" - "/nix:/nix" ]; environment = { CONFIG_FILE = "/config.yaml"; @@ -70,7 +68,6 @@ in "${act_config_path}:/config.yaml" "${act_path}/stable-latest-2/data:/data" "/var/run/docker.sock:/var/run/docker.sock" - "/nix:/nix" ]; environment = { CONFIG_FILE = "/config.yaml"; diff --git a/systems/palatine-hill/docker/act_config.yaml b/systems/palatine-hill/docker/act_config.yaml index f66fa4c..bb4f7ec 100644 --- a/systems/palatine-hill/docker/act_config.yaml +++ b/systems/palatine-hill/docker/act_config.yaml @@ -79,8 +79,7 @@ container: # If you want to allow any volume, please use the following configuration: # valid_volumes: # - '**' - valid_volumes: - - /nix + valid_volumes: [] # overrides the docker client host with the specified one. # If it's empty, act_runner will find an available docker host automatically. # If it's "-", act_runner will find an available docker host automatically, but the docker host won't be mounted to the job containers and service containers. -- 2.48.1 From 761480ad61db20dcb5bae08ea0a97fb12c3d0bcc Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Wed, 26 Mar 2025 00:39:45 -0400 Subject: [PATCH 7/7] add debug logging, shutdown timeout, revert container choice --- systems/palatine-hill/docker/act_config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/systems/palatine-hill/docker/act_config.yaml b/systems/palatine-hill/docker/act_config.yaml index bb4f7ec..37c4609 100644 --- a/systems/palatine-hill/docker/act_config.yaml +++ b/systems/palatine-hill/docker/act_config.yaml @@ -3,7 +3,7 @@ # just run `./act_runner generate-config > config.yaml` to generate a config file. log: # The level of logging, can be trace, debug, info, warn, error, fatal - level: info + level: debug runner: # Where to store the registration result. file: .runner @@ -22,7 +22,7 @@ runner: timeout: 3h # The timeout for the runner to wait for running jobs to finish when shutting down. # Any running jobs that haven't finished after this timeout will be cancelled. - shutdown_timeout: 0s + shutdown_timeout: 30m # Whether skip verifying the TLS certificate of the Gitea instance. insecure: false # The timeout for fetching the job from the Gitea instance. @@ -35,9 +35,9 @@ runner: # If it's empty when registering, it will ask for inputting labels. # If it's empty when execute `daemon`, will use labels in `.runner` file. labels: - - "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest-full" - - "ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04-full" - - "ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04-full" + - "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest" + - "ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04" + - "ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04" #cache: # Enable cache server to use actions/cache. #enabled: true -- 2.48.1