Skip to content

Commit 2fedbd2

Browse files
committed
initial commit
Signed-off-by: kpango <kpango@vdaas.org>
0 parents  commit 2fedbd2

174 files changed

Lines changed: 49987 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/docker/action.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: "Docker Action"
2+
description: "Build or Merge Docker images using the repository's Makefile."
3+
inputs:
4+
operation:
5+
description: "The operation to perform (build or merge)"
6+
required: true
7+
target:
8+
description: "The Makefile target to run"
9+
required: true
10+
docker_user:
11+
description: "DockerHub username"
12+
required: true
13+
default: "kpango"
14+
docker_pass:
15+
description: "DockerHub password"
16+
required: true
17+
github_token:
18+
description: "GitHub Token"
19+
required: true
20+
docker_push:
21+
description: "Whether this is a push build"
22+
required: false
23+
default: "false"
24+
platform:
25+
description: "The platform to build"
26+
required: false
27+
suffix:
28+
description: "The suffix for the docker tag"
29+
required: false
30+
ghcr_user:
31+
description: "GHCR username"
32+
required: false
33+
default: ${{ github.repository_owner }}
34+
35+
runs:
36+
using: "composite"
37+
steps:
38+
- name: Set up QEMU
39+
if: inputs.operation == 'build'
40+
uses: docker/setup-qemu-action@v4
41+
with:
42+
image: tonistiigi/binfmt:master
43+
44+
- name: Login to DockerHub
45+
if: inputs.operation == 'merge' || inputs.docker_push == 'true'
46+
uses: docker/login-action@v4
47+
with:
48+
username: ${{ inputs.docker_user }}
49+
password: ${{ inputs.docker_pass }}
50+
51+
- name: Login to GitHub Container Registry
52+
if: inputs.operation == 'merge' || inputs.docker_push == 'true'
53+
uses: docker/login-action@v4
54+
with:
55+
registry: ghcr.io
56+
username: ${{ github.actor }}
57+
password: ${{ inputs.github_token }}
58+
59+
- name: Create Buildx
60+
if: inputs.operation == 'build'
61+
shell: bash
62+
env:
63+
GITHUB_ACCESS_TOKEN: ${{ inputs.github_token }}
64+
DOCKER_BUILDER_PLATFORM: ${{ inputs.platform }}
65+
run: |
66+
make \
67+
DOCKER_BUILDER_PLATFORM="$DOCKER_BUILDER_PLATFORM" \
68+
GITHUB_ACCESS_TOKEN="$GITHUB_ACCESS_TOKEN" \
69+
create_buildx
70+
71+
- name: Run Makefile target
72+
shell: bash
73+
env:
74+
OPERATION: ${{ inputs.operation }}
75+
TARGET: ${{ inputs.target }}
76+
USER_DEFAULT: ${{ inputs.docker_user }}
77+
GHCR_USER: ${{ inputs.ghcr_user }}
78+
DOCKER_PUSH: ${{ inputs.docker_push }}
79+
GITHUB_ACCESS_TOKEN: ${{ inputs.github_token }}
80+
DOCKER_BUILDER_PLATFORM: ${{ inputs.platform }}
81+
DOCKER_ARCH_SUFFIX: ${{ inputs.suffix }}
82+
EVENT_NAME: ${{ github.event_name }}
83+
EVENT_PATH: ${{ github.event_path }}
84+
GITHUB_REF_VAR: ${{ github.ref }}
85+
run: |
86+
VERSION="nightly"
87+
88+
if [ "$EVENT_NAME" == "pull_request" ]; then
89+
PR_NUM=$(jq -r ".number" "$EVENT_PATH")
90+
VERSION="pr-$PR_NUM"
91+
elif [[ "$GITHUB_REF_VAR" == refs/tags/* ]]; then
92+
VERSION="${GITHUB_REF_VAR#refs/tags/}"
93+
fi
94+
95+
if [ "$OPERATION" == "build" ]; then
96+
make \
97+
DOCKER_PUSH="$DOCKER_PUSH" \
98+
USER="$USER_DEFAULT" \
99+
SYS_USER="$USER_DEFAULT" \
100+
USER_ID="1000" \
101+
GROUP_ID="1000" \
102+
GROUP_IDS="1000 98 972 987 994 996 998 1001 1002 1003 1004 1005" \
103+
GHCR_USER="$GHCR_USER" \
104+
VERSION="$VERSION" \
105+
GITHUB_ACCESS_TOKEN="$GITHUB_ACCESS_TOKEN" \
106+
DOCKER_BUILDER_PLATFORM="$DOCKER_BUILDER_PLATFORM" \
107+
DOCKER_ARCH_SUFFIX="$DOCKER_ARCH_SUFFIX" \
108+
"$TARGET"
109+
else
110+
make \
111+
USER="$USER_DEFAULT" \
112+
GHCR_USER="$GHCR_USER" \
113+
VERSION="$VERSION" \
114+
"$TARGET"
115+
fi

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "Build docker images"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags:
7+
- "*.*.*"
8+
- "v*.*.*"
9+
- "*.*.*-*"
10+
- "v*.*.*-*"
11+
paths:
12+
- "dockers/**"
13+
- "Makefile"
14+
- ".github/workflows/**"
15+
pull_request:
16+
paths:
17+
- "dockers/**"
18+
- "Makefile"
19+
- ".github/workflows/**"
20+
workflow_dispatch:
21+
schedule:
22+
- cron: "0 0 * * *"
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: true
26+
jobs:
27+
base:
28+
uses: ./.github/workflows/docker-reusable.yml
29+
with:
30+
build_target: build_base
31+
merge_target: merge_base
32+
secrets: inherit
33+
34+
images:
35+
needs: base
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
image: [dart, docker, env, gcloud, go, k8s, nim, rust]
40+
uses: ./.github/workflows/docker-reusable.yml
41+
with:
42+
build_target: build_${{ matrix.image }}
43+
merge_target: merge_${{ matrix.image }}
44+
secrets: inherit
45+
46+
dev:
47+
needs: [base, images]
48+
if: |
49+
always() &&
50+
needs.base.result == 'success' &&
51+
!cancelled()
52+
uses: ./.github/workflows/docker-reusable.yml
53+
with:
54+
build_target: prod_build
55+
merge_target: merge_dev
56+
secrets: inherit
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "Reusable Docker Build & Merge"
2+
on:
3+
workflow_call:
4+
inputs:
5+
build_target:
6+
required: true
7+
type: string
8+
merge_target:
9+
required: true
10+
type: string
11+
12+
jobs:
13+
build:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
arch:
18+
- platform: linux/amd64
19+
runner: ubuntu-latest
20+
suffix: amd64
21+
- platform: linux/arm64/v8
22+
runner: ubuntu-24.04-arm
23+
suffix: arm64
24+
runs-on: ${{ matrix.arch.runner }}
25+
environment: copilot
26+
steps:
27+
- uses: actions/checkout@v6
28+
with:
29+
fetch-depth: 1
30+
31+
- name: Build and Push Docker Image
32+
uses: ./.github/actions/docker
33+
with:
34+
operation: build
35+
target: ${{ inputs.build_target }}
36+
docker_user: ${{ secrets.DOCKERHUB_USER || 'kpango' }}
37+
docker_pass: ${{ secrets.DOCKERHUB_PASS }}
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
docker_push: true
40+
platform: ${{ matrix.arch.platform }}
41+
suffix: ${{ matrix.arch.suffix }}
42+
43+
merge:
44+
needs: build
45+
runs-on: ubuntu-latest
46+
environment: copilot
47+
steps:
48+
- uses: actions/checkout@v6
49+
with:
50+
fetch-depth: 1
51+
52+
- name: Merge and Push Manifest
53+
uses: ./.github/actions/docker
54+
with:
55+
operation: merge
56+
target: ${{ inputs.merge_target }}
57+
docker_user: ${{ secrets.DOCKERHUB_USER || 'kpango' }}
58+
docker_pass: ${{ secrets.DOCKERHUB_PASS }}
59+
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitinore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
nvim/site/*
2+
nvim/log/*
3+
nvim/plugin/*
4+
5+
# Binaries for programs and plugins
6+
*.exe
7+
*.exe~
8+
*.dll
9+
*.so
10+
*.dylib
11+
*.bin
12+
13+
# Test binary, built with `go test -c`
14+
*.test
15+
16+
# Output of the go coverage tool, specifically when used with LiteIDE
17+
*.out
18+
19+
.idea/
20+
21+
*.hdf5
22+
23+
.DS_Store
24+
.nvimlog
25+
26+
telepresence.log

.whitesource

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"generalSettings": {
3+
"shouldScanRepo": true
4+
},
5+
"checkRunSettings": {
6+
"vulnerableCheckRunConclusionLevel": "failure"
7+
}
8+
}

0 commit comments

Comments
 (0)