-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
106 changed files
with
1,522 additions
and
388 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,12 @@ | ||
// For format details, see https://containers.dev | ||
{ | ||
"name": "container-image-csi-driver dev container", | ||
"image": "ghcr.io/warm-metal/container-image-csi-driver/devcontainer:latest", | ||
|
||
// Setup the go environment and mount into the dev container at the expected location | ||
"workspaceFolder": "/go/src/github.com/warm-metal/container-image-csi-driver", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/go/src/github.com/warm-metal/container-image-csi-driver,type=bind,consistency=cached", | ||
|
||
// Copy over welcome message | ||
"postCreateCommand": "sudo cp .devcontainer/welcome.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt" | ||
} |
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 @@ | ||
👋 Welcome to your development environment for Container Image CSI Driver! | ||
|
||
This debian dev container image contains all tools needed for development. | ||
|
||
Get started right away! 🚀 | ||
|
||
Check out the guide in docs/running-locally.md |
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 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:ubuntu |
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,47 @@ | ||
// For format details, see https://containers.dev | ||
{ | ||
"name": "container-image-csi-driver dev container", | ||
// Workaround as mentioned in | ||
// https://github.com/devcontainers/ci/issues/191#issuecomment-1473518609 | ||
|
||
//"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"build": { | ||
"dockerfile": "./Dockerfile", | ||
"context": "." | ||
}, | ||
|
||
"otherPortsAttributes": { | ||
"onAutoForward": "silent" | ||
}, | ||
|
||
"features": { | ||
"ghcr.io/devcontainers/features/go:1": { | ||
"version": "1.19" | ||
}, | ||
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": { | ||
"version": "latest", | ||
"helm": "latest", | ||
"minikube": "none" | ||
}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": { | ||
"dockerDashComposeVersion": "v2" | ||
}, | ||
"ghcr.io/devcontainers-contrib/features/kind:1": {} | ||
}, | ||
|
||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"terminal.integrated.defaultProfile.linux": "zsh", | ||
"terminal.integrated.profiles.linux": { | ||
"zsh": { | ||
"path": "zsh" | ||
} | ||
} | ||
}, | ||
"extensions": [ | ||
"golang.go" | ||
] | ||
} | ||
} | ||
} |
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 @@ | ||
* @warm-metal/csi-maintainers |
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,10 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
commit-message: | ||
prefix: "chore: [skip ci]" | ||
include: "scope" |
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
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,55 @@ | ||
name: Dev Container Build and Push Image | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- .github/workflows/devcontainer-build-and-push.yaml | ||
- '.github/.devcontainer/**' | ||
pull_request: | ||
paths: | ||
- .github/workflows/devcontainer-build-and-push.yaml | ||
- '.github/.devcontainer/**' | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Log in to the GitHub Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install updated skopeo | ||
# https://github.com/devcontainers/ci/issues/191#issuecomment-1416384710 | ||
run: | | ||
sudo apt purge buildah golang-github-containers-common podman skopeo | ||
sudo apt autoremove --purge | ||
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable" | ||
source /etc/os-release | ||
sudo sh -c "echo 'deb ${REPO_URL}/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list" | ||
sudo wget -qnv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key | ||
sudo apt-key add Release.key | ||
sudo apt-get update | ||
sudo apt-get install skopeo -y | ||
- name: Pre-build dev container image | ||
uses: devcontainers/ci@v0.3 | ||
with: | ||
subFolder: .github | ||
imageName: ghcr.io/${{ github.repository }}/devcontainer | ||
cacheFrom: ghcr.io/${{ github.repository }}/devcontainer | ||
platform: linux/amd64,linux/arm64 | ||
push: always |
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,65 @@ | ||
name: Create and publish the container image | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
BASE_REPOSITORY: warm-metal/container-image-csi-driver | ||
BASE_DEFAULT_BRANCH: main | ||
BASE_IMAGE_NAME: warmmetal/csi-image | ||
FORK_IMAGE_NAME: ghcr.io/${{ github.repository }} | ||
|
||
permissions: | ||
packages: write | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
if: github.repository == env.BASE_REPOSITORY | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Log in to the GitHub Container registry | ||
uses: docker/login-action@v3 | ||
if: github.repository != env.BASE_REPOSITORY | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
name=${{ env.BASE_IMAGE_NAME }},enable=${{ github.repository == env.BASE_REPOSITORY }} | ||
name=${{ env.FORK_IMAGE_NAME }},enable=${{ github.repository != env.BASE_REPOSITORY }} | ||
tags: | | ||
# set 'latest' tag for default branch | ||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', env.BASE_DEFAULT_BRANCH) }} | ||
# set image tag based on GitHub release tag | ||
type=semver,pattern={{version}},prefix=v | ||
# set the image tag based on the branch | ||
# https://github.com/docker/metadata-action/issues/247#issuecomment-1511259674 | ||
type=ref,event=branch,enable=${{ github.ref_name != env.BASE_DEFAULT_BRANCH }} | ||
flavor: | | ||
latest=false | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,27 @@ | ||
name: Delete old container images | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" # Source: https://crontab.guru/every-day | ||
|
||
permissions: | ||
packages: write | ||
|
||
env: | ||
BASE_REPOSITORY: warm-metal/container-image-csi-driver | ||
|
||
jobs: | ||
clean-ghcr: | ||
name: Delete old unused container images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/delete-package-versions@v5 | ||
if: github.repository != env.BASE_REPOSITORY | ||
with: | ||
owner: ${{ github.repository_owner }} | ||
package-name: ${{ github.event.repository.name }} | ||
package-type: 'container' | ||
min-versions-to-keep: 1 | ||
# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string | ||
# Ignore any semver or 'latest' | ||
ignore-versions: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?|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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: test-metrics-5m | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
jobs: | ||
integration: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Start a kind cluster with containerd | ||
uses: helm/kind-action@v1.8.0 | ||
with: | ||
cluster_name: kind-${{ github.run_id }} | ||
kubectl_version: "v1.25.2" | ||
config: ./hack/ci/containerd-cluster-conf.yaml | ||
- name: Build image | ||
run: ./hack/ci/build.sh | ||
- name: Set image version | ||
run: | | ||
echo "VALUE_FILE=charts/warm-metal-csi-driver/values.yaml" >> "$GITHUB_ENV" | ||
echo "IMAGE_TAG=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV" | ||
echo "HELM_NAME=wm-csi-integration-tests" >> "$GITHUB_ENV" | ||
- name: Install the CSI Driver | ||
run: | | ||
trap "kubectl -n kube-system describe po" ERR | ||
helm install ${HELM_NAME} charts/warm-metal-csi-driver -n kube-system \ | ||
-f ${VALUE_FILE} \ | ||
--set csiPlugin.image.tag=${IMAGE_TAG} \ | ||
--wait \ | ||
--debug | ||
- name: Test metrics | ||
run: ./test/integration/test-metrics.sh | ||
- name: Uninstall the CSI Driver | ||
run: helm uninstall -n kube-system ${HELM_NAME} --wait |
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
Oops, something went wrong.