Skip to content

Commit

Permalink
Merge pull request #789 from socallinuxexpo/rh/devserver-runners
Browse files Browse the repository at this point in the history
[READY] - init devServer gitlab runner
  • Loading branch information
sarcasticadmin authored Nov 13, 2024
2 parents abdc6fa + 4e4dfdb commit 881790c
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 14 deletions.
7 changes: 0 additions & 7 deletions CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 21 additions & 0 deletions docs/gitlab-ci.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions nix/machines/devServer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
imports = [
./libvirt.nix
./gitlab.nix
];
# remove the annoying experimental warnings
nix.extraOptions = ''
Expand Down
17 changes: 17 additions & 0 deletions nix/machines/devServer/gitlab.nix
Original file line number Diff line number Diff line change
@@ -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 ];
}
1 change: 0 additions & 1 deletion nix/machines/flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ in
./_common/users.nix
./devServer/default.nix
./devServer/hardware-configuration.nix
inputs.microvm.nixosModules.host
];
};
loghost = lib.nixosSystem {
Expand Down

0 comments on commit 881790c

Please sign in to comment.