-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from jgiannuzzi/improvements
Many improvements
- Loading branch information
Showing
11 changed files
with
170 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.224.2/containers/ubuntu/.devcontainer/base.Dockerfile | ||
|
||
# [Choice] Ubuntu version (use hirsuite or bionic on local arm64/Apple Silicon): hirsute, focal, bionic | ||
ARG VARIANT="hirsute" | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# && apt-get -y install --no-install-recommends <your-package-list-here> | ||
|
||
# Install Packer | ||
ARG PACKER_VERSION="1.8.0" | ||
ARG PACKER_ARCH="amd64" | ||
RUN set -x \ | ||
&& TMPDIR=$(mktemp -d) \ | ||
&& cd $TMPDIR \ | ||
&& curl -fsSLo packer.zip https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_${PACKER_ARCH}.zip \ | ||
&& unzip packer.zip \ | ||
&& install packer /usr/local/bin \ | ||
&& rm -rf $TMPDIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.224.2/containers/ubuntu | ||
{ | ||
"name": "Ubuntu", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
// Update 'VARIANT' to pick an Ubuntu version: hirsute, focal, bionic | ||
// Use hirsute or bionic on local arm64/Apple Silicon. | ||
// Set 'PACKER_ARCH' to arm64 on local arm64/Apple Silicon. | ||
"args": { | ||
"VARIANT": "hirsute", | ||
"PACKER_ARCH": "amd64" | ||
} | ||
}, | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": {}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"4ops.packer" | ||
], | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "uname -a", | ||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode", | ||
"features": { | ||
"git": "os-provided", | ||
"github-cli": "latest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.env | ||
gcp.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
#!/bin/bash | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
echo "[INFO] > Disable unattended upgrades services" | ||
systemctl disable --now unattended-upgrades.service | ||
|
||
echo "[INFO] > Prepare the system before installing drivers" | ||
apt-get install -y gcc make pkg-config | ||
apt-get update | ||
apt-get install -y build-essential | ||
|
||
echo "[INFO] > Installing deeplearning drivers" | ||
curl -O -L $DRIVERS_URL/$DRIVERS_SCRIPT | ||
chmod +x $DRIVERS_SCRIPT | ||
./$DRIVERS_SCRIPT -s | ||
echo "[INFO] > Installing NVIDIA drivers" | ||
curl -o nvidia.run -fsSL https://us.download.nvidia.com/tesla/${NVIDIA_VERSION}/NVIDIA-Linux-x86_64-${NVIDIA_VERSION}.run | ||
sh nvidia.run --ui=none -q | ||
rm nvidia.run | ||
|
||
echo "[INFO] > Creating user ghrunner with home directory" | ||
/usr/sbin/useradd -m ghrunner | ||
cd /home/ghrunner | ||
mkdir -p workdir/actions-runner && cd workdir/actions-runner | ||
echo "[INFO] > Creating user runner with home directory" | ||
/usr/sbin/useradd -m runner | ||
mkdir ~runner/runner | ||
|
||
echo "[INFO] > Downloading runner tar archive from Github" | ||
ARCHIVE=actions-runner-linux-x64-$RUNNER_VERSION.tar.gz | ||
curl -O -L https://github.com/actions/runner/releases/download/v$RUNNER_VERSION/$ARCHIVE | ||
tar xzf ./$ARCHIVE | ||
rm $ARCHIVE | ||
chown -R ghrunner ~ghrunner | ||
echo "[INFO] > Installing GitHub Actions runner" | ||
curl -fsSL https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz | tar -C ~runner/runner -xzf - | ||
chown -R runner:runner ~runner/runner | ||
|
||
echo "[INFO] > Installing runner dependencies" | ||
/home/ghrunner/workdir/actions-runner/bin/installdependencies.sh | ||
echo "[INFO] > Installing GitHub Actions runner dependencies" | ||
~runner/runner/bin/installdependencies.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
zone = "europe-west4-a" | ||
image_family = "ubuntu-2004-ghr-nvidia" | ||
source_image = "ubuntu-2004-focal-v20220308" | ||
source_image_project_id = "ubuntu-os-cloud" | ||
machine_type = "a2-highgpu-1g" | ||
runner_version = "2.288.1" | ||
nvidia_version = "470.103.01" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
variable "project" { type = string } | ||
variable "zone" { type = string } | ||
variable "source_image_project_id" { type = list(string) } | ||
variable "disk_size" { type = number } | ||
variable "source_image_family" { type = string } | ||
variable "source_image" { type = string } | ||
variable "ghrunner_version" { type = string } | ||
variable "machine_type" { type = string } | ||
variable "drivers_url" { type = string } | ||
variable "drivers_script" { type = string } | ||
variable "project" { type = string } | ||
variable "zone" { type = string } | ||
variable "image_family" { type = string } | ||
variable "source_image" { type = string } | ||
variable "source_image_project_id" { type = string } | ||
variable "machine_type" { type = string } | ||
variable "runner_version" { type = string } | ||
variable "nvidia_version" { type = string } |