Skip to content

Commit

Permalink
Use local DNS zone for services in both envs (#60)
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Jacobelli <[email protected]>
  • Loading branch information
jjacobelli authored May 17, 2024
1 parent 78c4f72 commit af3ecba
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 36 deletions.
10 changes: 0 additions & 10 deletions build.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ build {
destination = "${local.context_directory}"
}

provisioner "file" {
source = "${path.root}/config.yaml"
destination = "${local.context_directory}/config.yaml"
}

provisioner "shell" {
environment_vars = [
"DEBIAN_FRONTEND=noninteractive",
Expand Down Expand Up @@ -117,11 +112,6 @@ build {
destination = "${local.context_directory}"
}

provisioner "file" {
source = "${path.root}/config.yaml"
destination = "${local.context_directory}/config.yaml"
}

# this restart is necessary to make sure the environment variables are
# available to the subsequent scripts
provisioner "windows-restart" {}
Expand Down
10 changes: 0 additions & 10 deletions config.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion linux/context/buildkitd.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[registry."docker.io"]
mirrors = ["https://dc.$DOMAIN.gha-runners.nvidia.com"]
mirrors = ["https://dc.local.gha-runners.nvidia.com"]
2 changes: 1 addition & 1 deletion linux/context/dockerd.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"exec-opts": ["native.cgroupdriver=cgroupfs"],
"registry-mirrors": ["https://dc.$DOMAIN.gha-runners.nvidia.com"]
"registry-mirrors": ["https://dc.local.gha-runners.nvidia.com"]
}
8 changes: 4 additions & 4 deletions linux/context/fluent-bit/common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[OUTPUT]
Name http
Match cpu
Host logs.${DOMAIN}.gha-runners.nvidia.com
Host logs.local.gha-runners.nvidia.com
Port 443
Uri /cpu
Format json
Expand All @@ -27,7 +27,7 @@
[OUTPUT]
Name http
Match kernel
Host logs.${DOMAIN}.gha-runners.nvidia.com
Host logs.local.gha-runners.nvidia.com
Port 443
Uri /kernel
Format json
Expand All @@ -41,7 +41,7 @@
[OUTPUT]
Name http
Match memory
Host logs.${DOMAIN}.gha-runners.nvidia.com
Host logs.local.gha-runners.nvidia.com
Port 443
Uri /memory
Format json
Expand All @@ -54,7 +54,7 @@
[OUTPUT]
Name http
Match systemd
Host logs.${DOMAIN}.gha-runners.nvidia.com
Host logs.local.gha-runners.nvidia.com
Port 443
Uri /systemd
Format json
Expand Down
6 changes: 2 additions & 4 deletions linux/installers/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ sudo mv docker-compose* /usr/libexec/docker/cli-plugins/docker-compose

# Add Docker mirror to daemon.json and buildkitd.toml
sudo mkdir -p /etc/docker /etc/buildkit
DOMAIN=$(yq '.[env(NV_RUNNER_ENV)].domain' "${NV_CONTEXT_DIR}/config.yaml")
export DOMAIN
envsubst < "${NV_CONTEXT_DIR}/dockerd.json" | sudo tee /etc/docker/daemon.json
envsubst < "${NV_CONTEXT_DIR}/buildkitd.toml" | sudo tee /etc/buildkit/buildkitd.toml
sudo cp "${NV_CONTEXT_DIR}/dockerd.json" /etc/docker/daemon.json
sudo cp "${NV_CONTEXT_DIR}/buildkitd.toml" /etc/buildkit/buildkitd.toml

# Set MTU for qemu env
# shellcheck disable=SC2002
Expand Down
5 changes: 1 addition & 4 deletions linux/installers/fluent-bit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ sudo apt-get update
sudo apt-get install --no-install-recommends -y fluent-bit
sudo systemctl enable fluent-bit

DOMAIN=$(yq '.[env(NV_RUNNER_ENV)].domain' "${NV_CONTEXT_DIR}/config.yaml")
export DOMAIN

FLUENTBIT_CONFD="/etc/fluent-bit/conf.d"
sudo mkdir -p "${FLUENTBIT_CONFD}"

sudo cp "${NV_CONTEXT_DIR}/fluent-bit/fluent-bit.conf" /etc/fluent-bit/fluent-bit.conf
envsubst < "${NV_CONTEXT_DIR}/fluent-bit/common.conf" | sudo tee "${FLUENTBIT_CONFD}/common.conf"
sudo cp "${NV_CONTEXT_DIR}/fluent-bit/common.conf" "${FLUENTBIT_CONFD}/common.conf"

if [ -d "${NV_CONTEXT_DIR}/fluent-bit/${NV_RUNNER_ENV}" ]; then
sudo cp -r "${NV_CONTEXT_DIR}/fluent-bit/${NV_RUNNER_ENV}"/* "${FLUENTBIT_CONFD}/"
Expand Down
3 changes: 1 addition & 2 deletions windows/installers/docker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ Remove-Item docker.zip

$dockerDefaultConfigPath = "$env:ProgramData/docker/config"
mkdir -Force -ErrorAction SilentlyContinue -Path "$dockerDefaultConfigPath"
$domain = yq '.[env(NV_RUNNER_ENV)].domain' "${env:NV_CONTEXT_DIR}/config.yaml"

@"
{
"group": "docker",
"registry-mirrors": ["https://dc.${domain}.gha-runners.nvidia.com"]
"registry-mirrors": ["https://dc.local.gha-runners.nvidia.com"]
}
"@ > "$dockerDefaultConfigPath/daemon.json"

Expand Down

0 comments on commit af3ecba

Please sign in to comment.