Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .github/workflows/container-images-1.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Build and push slurm-operator container images to Docker Hub (1.0 line).
#
# Tagging:
# - push to slurm-1.0-together-changes: togethercomputer/slurm-operator:<VERSION> (from ./VERSION, no suffix)
# - pull_request (same-repo only): ...:<VERSION>-dev-<short_sha>
#
# GitHub only evaluates workflows that exist on the ref being pushed. This file must live on
# slurm-1.0-together-changes (not only on main), or pushes to that branch will not run any workflow.
#
# Required repository secrets:
# - DOCKERHUB_USERNAME
# - DOCKERHUB_TOKEN
# Optional:
# - ROBOT_GITHUB_TOKEN

name: Container images v1.0

on:
pull_request:
branches:
- slurm-1.0-together-changes
push:
branches:
- slurm-1.0-together-changes
workflow_dispatch:

env:
REGISTRY: togethercomputer
RELEASE_BRANCH: slurm-1.0-together-changes

concurrency:
group: container-images-1.0-${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0

- name: Set image VERSION for docker-bake
id: image-version
run: |
set -euo pipefail
BASE="$(tr -d ' \n\r\t' < VERSION)"
SHORT="$(git rev-parse --short HEAD)"
if [ "${{ github.event_name }}" = "pull_request" ]; then
IMG="${BASE}-dev-${SHORT}"
else
IMG="${BASE}"
fi
echo "version=${IMG}" >> "$GITHUB_OUTPUT"
echo "Image VERSION (make/docker-bake): ${IMG}"

- name: Whether to push to Docker Hub
id: should-push
env:
RELEASE_REF: refs/heads/${{ env.RELEASE_BRANCH }}
run: |
if [ "${{ github.event_name }}" = "push" ] && [ "${{ github.ref }}" = "${RELEASE_REF}" ]; then
echo "push=true" >> "$GITHUB_OUTPUT"
elif [ "${{ github.event_name }}" = "pull_request" ] && \
[ "${{ github.event.pull_request.head.repo.full_name }}" = "${{ github.repository }}" ]; then
echo "push=true" >> "$GITHUB_OUTPUT"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.ref }}" = "${RELEASE_REF}" ]; then
echo "push=true" >> "$GITHUB_OUTPUT"
else
echo "push=false" >> "$GITHUB_OUTPUT"
fi

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Configure git for private Go modules
run: |
git config --global url."https://together-robot:${ROBOT_GITHUB_TOKEN}@github.com/togethercomputer/".insteadOf "https://github.com/togethercomputer/"
env:
ROBOT_GITHUB_TOKEN: ${{ secrets.ROBOT_GITHUB_TOKEN }}

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.16.3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
if: steps.should-push.outputs.push == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build (images + charts, no registry push)
if: steps.should-push.outputs.push != 'true'
run: make build VERSION="${{ steps.image-version.outputs.version }}"

- name: Package charts (push path)
if: steps.should-push.outputs.push == 'true'
run: make build-chart

- name: Build and push images
if: steps.should-push.outputs.push == 'true'
run: make push-images VERSION="${{ steps.image-version.outputs.version }}"
141 changes: 141 additions & 0 deletions .gitignore.orig
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Created by https://www.toptal.com/developers/gitignore/api/go,helm,linux,macos,windows,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=go,helm,linux,macos,windows,visualstudiocode

### Go ###
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
*~
.idea
*.swp
*.swo
bin/*
govulncheck-vulns.csv

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tooling, specifically when used with LiteIDE
*.out
cover.html

# Dependency directories (remove the comment below to include it)
!vendor/**/zz_generated.*

# Go workspace file
go.work

### Helm ###
# Chart dependencies
**/charts/*.tgz

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/go,helm,linux,macos,windows,visualstudiocode

go.work.sum
Dockerfile.cross
vendor/*
*.tgz
values-*.yaml
.helm_ls_cache
docs/build/html
*debug_bin*
bake-metadata.json
8 changes: 8 additions & 0 deletions .gitignore.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@@ -137,3 +137,7 @@
.helm_ls_cache
docs/build/html
*debug_bin*
+test-values.yaml
+
+# codemogger db
+.codemogger/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ version-match: version ## Check if versions are consistent.
.PHONY: all
all: build ## Build slurm-operator.

REGISTRY ?= slinky.slurm.net
REGISTRY ?= togethercomputer
BUILDER ?= project-v3-builder
BAKE_METADATA_FILE ?= bake-metadata.json

Expand Down
Loading