Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[READY] - init devServer gitlab runner #789

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we rename CI.md to github-actions-ci.md?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a branch that moves all of these markdown files underneath docs/(since right now there spread all over). Id rather clean that up there if thats ok since well be moving it anyway.

- [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";
sarcasticadmin marked this conversation as resolved.
Show resolved Hide resolved
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
sarcasticadmin marked this conversation as resolved.
Show resolved Hide resolved
];
};
loghost = lib.nixosSystem {
Expand Down
Loading