feat: more improvements to devcontainer and arm64 (#1242)
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 parent
3a646eec30
commit
0eda6492fa
8 files changed
+54
-56
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
#Ref: https://github.com/devcontainers/ci/issues/191
|
||||||
|
FROM mcr.microsoft.com/devcontainers/base:alpine
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
|
||||||
"name": "Flux Cluster Template (CI)",
|
"name": "Flux Cluster Template (CI)",
|
||||||
"image": "mcr.microsoft.com/devcontainers/base:alpine",
|
"build": {
|
||||||
|
"dockerfile": "./Dockerfile",
|
||||||
|
"context": "."
|
||||||
|
},
|
||||||
"features": {
|
"features": {
|
||||||
"./features": {}
|
"./features": {}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Flux Cluster Template (Dev Tooling)",
|
"name": "Flux Cluster Template (Tools)",
|
||||||
"id": "flux-cluster-template",
|
"id": "flux-cluster-template",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "Install Development Tools"
|
"description": "Install Tools"
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
set -o noglob
|
||||||
|
|
||||||
ARCH="$(uname -m)"
|
ARCH="$(uname -m)"
|
||||||
if [ "$ARCH" == "x86_64" ]; then
|
if [ "$ARCH" = "x86_64" ]; then
|
||||||
ARCH="amd64"
|
ARCH="amd64"
|
||||||
elif [ "$ARCH" == "aarch64" ]; then
|
elif [ "$ARCH" = "aarch64" ]; then
|
||||||
ARCH="arm64"
|
ARCH="arm64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -13,29 +15,30 @@ fi
|
|||||||
|
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
bash bind-tools ca-certificates curl python3 \
|
bash bind-tools ca-certificates curl python3 \
|
||||||
py3-pip moreutils jq git \
|
py3-pip moreutils jq git iputils \
|
||||||
openssh-client
|
openssh-client
|
||||||
|
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
|
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
|
||||||
age direnv fish github-cli \
|
age direnv fish helm kubectl kustomize sops yq
|
||||||
go-task helm k0sctl kubectl \
|
|
||||||
kustomize sops yq
|
|
||||||
|
|
||||||
apk add --no-cache \
|
|
||||||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \
|
|
||||||
cilium-cli flux stern
|
|
||||||
|
|
||||||
# Naming things is hard
|
|
||||||
ln -s /usr/bin/go-task /usr/local/bin/task
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Install Tools not in Alpine Repositories
|
# Install Tools not in Alpine Repositories
|
||||||
#
|
#
|
||||||
|
|
||||||
curl https://i.jpillora.com/cloudflare/cloudflared! | sudo bash
|
for installer_path in \
|
||||||
curl https://i.jpillora.com/budimanjojo/talhelper! | sudo bash
|
"budimanjojo/talhelper!" \
|
||||||
curl https://i.jpillora.com/yannh/kubeconform! | sudo bash
|
"cilium/cilium-cli!!?as=cilium" \
|
||||||
|
"cli/cli!!?as=gh" \
|
||||||
|
"cloudflare/cloudflared!" \
|
||||||
|
"fluxcd/flux2!!?as=flux" \
|
||||||
|
"go-task/task!" \
|
||||||
|
"k0sproject/k0sctl!" \
|
||||||
|
"stern/stern!" \
|
||||||
|
"yannh/kubeconform!"
|
||||||
|
do
|
||||||
|
curl -fsSL "https://i.jpillora.com/${installer_path}" | bash
|
||||||
|
done
|
||||||
|
|
||||||
curl -fsSL -o /usr/local/bin/talosctl \
|
curl -fsSL -o /usr/local/bin/talosctl \
|
||||||
"https://github.com/siderolabs/talos/releases/latest/download/talosctl-linux-${ARCH}"
|
"https://github.com/siderolabs/talos/releases/latest/download/talosctl-linux-${ARCH}"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
|
||||||
"name": "Flux Cluster Template",
|
"name": "Flux Cluster Template",
|
||||||
"image": "ghcr.io/onedr0p/flux-cluster-template/devcontainer:base",
|
"image": "ghcr.io/onedr0p/flux-cluster-template/devcontainer:base",
|
||||||
"postCreateCommand": {
|
"postCreateCommand": {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
paths: [".devcontainer/ci/devcontainer.json"]
|
paths: [".devcontainer/ci/**"]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
paths: [".devcontainer/ci/devcontainer.json"]
|
paths: [".devcontainer/ci/**"]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * 1"
|
- cron: "0 0 * * 1"
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
devcontainer:
|
devcontainer:
|
||||||
name: Publish devcontainer
|
name: publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -27,13 +27,13 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# - name: Set up QEMU
|
- name: Set up QEMU
|
||||||
# uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
# - name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
# uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
# with:
|
with:
|
||||||
# platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
- if: ${{ github.event_name != 'pull_request' }}
|
- if: ${{ github.event_name != 'pull_request' }}
|
||||||
name: Login to GitHub Container Registry
|
name: Login to GitHub Container Registry
|
||||||
@@ -45,9 +45,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: devcontainers/ci@v0.3
|
uses: devcontainers/ci@v0.3
|
||||||
|
env:
|
||||||
|
BUILDX_NO_DEFAULT_ATTESTATIONS: true
|
||||||
with:
|
with:
|
||||||
imageName: ghcr.io/${{ github.repository }}/devcontainer
|
imageName: ghcr.io/${{ github.repository }}/devcontainer
|
||||||
|
cacheFrom: ghcr.io/${{ github.repository }}/devcontainer
|
||||||
imageTag: base,latest
|
imageTag: base,latest
|
||||||
# platform: linux/amd64,linux/arm64
|
platform: linux/amd64,linux/arm64
|
||||||
configFile: .devcontainer/ci/devcontainer.json
|
configFile: .devcontainer/ci/devcontainer.json
|
||||||
push: ${{ github.event_name == 'pull_request' && 'never' || 'always' }}
|
push: ${{ github.event_name == 'pull_request' && 'never' || 'always' }}
|
||||||
@@ -11,25 +11,6 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
yay:
|
|
||||||
name: workstation (yay)
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: greyltc/archlinux-aur:yay
|
|
||||||
options: --user root
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Test Arch dependencies
|
|
||||||
shell: bash
|
|
||||||
run: >-
|
|
||||||
sudo -E -u ab -D~ bash -c '
|
|
||||||
cd $GITHUB_WORKSPACE;
|
|
||||||
yay -Syu --needed --noconfirm --noprogressbar go-task;
|
|
||||||
go-task workstation:yay
|
|
||||||
'
|
|
||||||
|
|
||||||
configure:
|
configure:
|
||||||
name: configure
|
name: configure
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -158,17 +158,23 @@ Once you have installed Talos or Debian on your nodes, there are six stages to g
|
|||||||
|
|
||||||
3. Continue on to 🌱 [**Stage 2**](#-stage-2-setup-your-local-workstation-environment)
|
3. Continue on to 🌱 [**Stage 2**](#-stage-2-setup-your-local-workstation-environment)
|
||||||
|
|
||||||
### 🌱 Stage 2: Setup your local workstation environment
|
### 🌱 Stage 2: Setup your local workstation
|
||||||
|
|
||||||
|
#### devcontainer
|
||||||
|
|
||||||
|
1. The included `devcontainer` has all the required CLI tools installed all setup and ready to go. Open your repository in VSCode and switch to it.
|
||||||
|
|
||||||
|
2. Continue on to 🔧 [**Stage 3**](#-stage-3-do-bootstrap-configuration)
|
||||||
|
|
||||||
|
#### Non-devcontainer
|
||||||
|
|
||||||
1. Install the most recent version of [task](https://taskfile.dev/), see the [installation docs](https://taskfile.dev/installation/) for other supported platforms.
|
1. Install the most recent version of [task](https://taskfile.dev/), see the [installation docs](https://taskfile.dev/installation/) for other supported platforms.
|
||||||
|
|
||||||
📍 _If using **ArchLinux** the `task` command is `go-task` in your shell_
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Homebrew
|
# Homebrew
|
||||||
brew install go-task
|
brew install go-task
|
||||||
# or, Arch / yay
|
# or, Arch / yay
|
||||||
yay -S go-task
|
yay -S go-task && ln -sf /usr/bin/go-task /usr/local/bin/task
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Install the most recent version of [direnv](https://direnv.net/), see the [installation docs](https://direnv.net/docs/installation.html) for other supported platforms.
|
2. Install the most recent version of [direnv](https://direnv.net/), see the [installation docs](https://direnv.net/docs/installation.html) for other supported platforms.
|
||||||
@@ -182,11 +188,9 @@ Once you have installed Talos or Debian on your nodes, there are six stages to g
|
|||||||
|
|
||||||
📍 _After `direnv` is installed be sure to **[hook it into your preferred shell](https://direnv.net/docs/hook.html)** and then run `task workstation:direnv`_
|
📍 _After `direnv` is installed be sure to **[hook it into your preferred shell](https://direnv.net/docs/hook.html)** and then run `task workstation:direnv`_
|
||||||
|
|
||||||
3. Install **required** CLI tools: [age](https://github.com/FiloSottile/age), [cloudflared](https://github.com/cloudflare/cloudflared), [flux](https://toolkit.fluxcd.io/), [kubeconform](https://github.com/yannh/kubeconform), [kubectl](https://kubectl.docs.kubernetes.io/installation/), [kustomize](https://kubectl.docs.kubernetes.io/installation/), [sops](https://github.com/getsops/sops).
|
3. Install the additional **required** CLI tools
|
||||||
|
|
||||||
📍 _[k0sctl](https://github.com/k0sproject/k0sctl) is required for k0s. [talosctl](https://www.talos.dev/latest/learn-more/talosctl/) and [talhelper](https://github.com/budimanjojo/talhelper) is required for Talos._
|
📍 _**Not using Homebrew or ArchLinux?** Make sure to look up how to install the **latest** version of the CLI tools listed in the [Brewfile](.taskfiles/Workstation/Brewfile)/[Archfile](.taskfiles/Workstation/Archfile) and install them._
|
||||||
|
|
||||||
📍 _Not using Homebrew or ArchLinux? Make sure to look up how to install the latest version of each of these CLI tools and install them._
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Homebrew
|
# Homebrew
|
||||||
|
|||||||
Reference in new issue
Block a user