From fb00a9a7a71e6bb9cf81668490b6511a4d99deee Mon Sep 17 00:00:00 2001 From: Robert James Hernandez Date: Thu, 10 Oct 2024 20:08:54 +0000 Subject: [PATCH 1/4] nix: bump nixpkgs to nixos-24.05 --- flake.lock | 8 ++++---- flake.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 0cebc4c4..ec3ddcd2 100644 --- a/flake.lock +++ b/flake.lock @@ -84,16 +84,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1695830400, - "narHash": "sha256-gToZXQVr0G/1WriO83olnqrLSHF2Jb8BPcmCt497ro0=", + "lastModified": 1728500571, + "narHash": "sha256-dOymOQ3AfNI4Z337yEwHGohrVQb4yPODCW9MDUyAc4w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8a86b98f0ba1c405358f1b71ff8b5e1d317f5db2", + "rev": "d51c28603def282a24fa034bcb007e2bcb5b5dd0", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-24.05", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 0eabdbd0..8fbdf5fd 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.spectrum.follows = ""; }; # Currently using this fork since the upstream seems to be causing an issue - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; treefmt-nix = { url = "github:numtide/treefmt-nix"; From 3a3423f88e08f735774b7057f8de6bc1eb4b8493 Mon Sep 17 00:00:00 2001 From: Robert James Hernandez Date: Thu, 10 Oct 2024 19:58:39 +0000 Subject: [PATCH 2/4] devServer: init gitlab runner --- nix/machines/devServer/default.nix | 1 + nix/machines/devServer/gitlab.nix | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 nix/machines/devServer/gitlab.nix diff --git a/nix/machines/devServer/default.nix b/nix/machines/devServer/default.nix index c9fabad1..e568be70 100644 --- a/nix/machines/devServer/default.nix +++ b/nix/machines/devServer/default.nix @@ -3,6 +3,7 @@ { imports = [ ./libvirt.nix + ./gitlab.nix ]; # remove the annoying experimental warnings nix.extraOptions = '' diff --git a/nix/machines/devServer/gitlab.nix b/nix/machines/devServer/gitlab.nix new file mode 100644 index 00000000..51e5e1b1 --- /dev/null +++ b/nix/machines/devServer/gitlab.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: +{ + services.gitlab-runner = { + enable = true; + gracefulTermination = true; + services = { + shell = { + # make sure this is a quote path so it doesnt end up in /nix/store + authenticationTokenConfigFile = "/persist/etc/gitlab/shellAuthToken.env"; + executor = "shell"; + }; + }; + }; + + # include for gl-runner cli + environment.systemPackages = [ pkgs.gitlab-runner ]; +} From b38d10dee9d88f1bc3039d342fd897e1f193b824 Mon Sep 17 00:00:00 2001 From: Robert James Hernandez Date: Thu, 10 Oct 2024 20:30:09 +0000 Subject: [PATCH 3/4] devServer: remove microvm Will opt for leveraging kvm for the devServer going forward --- nix/machines/flake-module.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nix/machines/flake-module.nix b/nix/machines/flake-module.nix index 36c531f2..8f8fc32c 100644 --- a/nix/machines/flake-module.nix +++ b/nix/machines/flake-module.nix @@ -40,7 +40,6 @@ in ./_common/users.nix ./devServer/default.nix ./devServer/hardware-configuration.nix - inputs.microvm.nixosModules.host ]; }; loghost = lib.nixosSystem { From 4e4dfdbcf362b1dafce48b19c83701db292f2bcb Mon Sep 17 00:00:00 2001 From: Robert James Hernandez Date: Fri, 8 Nov 2024 07:14:07 +0000 Subject: [PATCH 4/4] gitlab-ci: adding docs for token gen --- CI.md | 7 ------- README.md | 3 ++- docs/gitlab-ci.md | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 docs/gitlab-ci.md diff --git a/CI.md b/CI.md index 36600f57..9802e64b 100644 --- a/CI.md +++ b/CI.md @@ -37,10 +37,3 @@ Wormhole code is: 8-amusement-drumbeat ``` 4. This will kickoff the flash and reply with a gitlab pipeline URL. - -## Gitlab CI - -See the pipelines defined: https://github.com/socallinuxexpo/scale-network/blob/master/.gitlab-ci.yml - -Our [autoflash process](./openwrt/docs/AUTOFLASH.md) leverages `gitlab-runners` to be able to interact with real hardware so that -we can automate the flashing process to test our openwrt images. diff --git a/README.md b/README.md index 354209a1..a0199a12 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ ## Table of Contents - [CONTRIBUTING](./CONTRIBUTING.md) -- [CI](./CI.md) +- [GitHub Actions CI](./CI.md) +- [Gitlab CI](./docs/gitlab-ci.md) - [MAPS](./MAPS.md) - [SWITCH CONFIG](./switch-configuration/README.md) - [OPENWRT](./openwrt/README.md) diff --git a/docs/gitlab-ci.md b/docs/gitlab-ci.md new file mode 100644 index 00000000..8e6c620d --- /dev/null +++ b/docs/gitlab-ci.md @@ -0,0 +1,21 @@ +# Gitlab + +See the pipelines defined: https://github.com/socallinuxexpo/scale-network/blob/master/.gitlab-ci.yml + +Our [autoflash process](./openwrt/docs/AUTOFLASH.md) leverages `gitlab-runners` to be able to interact with real hardware so that +we can automate the flashing process to test our openwrt images. + +## Generate token for runner + +1. Navigate to the [runner page](https://gitlab.com/groups/socallinuxexpo/-/runners) + +1. Click the `New Group Runner` + +1. Ensure that you have the right tags for the runner. These should match the `.gitlab-ci` jobs you expect to run. + +1. Add a description and set an appropriate timeout if different from the default. + +1. Take the token and place it on the runner. + +> NOTE: Runners cannot be configured with additional tags or config. These are encoded into the token. Should these +> config need to change you'll need a new token.