Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/client/python/pip-adbc831df1
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeLalor committed Jul 11, 2024
2 parents 5d6eadf + 4bf6065 commit f75c66b
Show file tree
Hide file tree
Showing 68 changed files with 2,561 additions and 2,944 deletions.
84 changes: 65 additions & 19 deletions .github/workflows/version_k8_op.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bump Version and Release K8 Operator
on:
workflow_run:
workflows: [ "Test K8 Operator" ] # The name of the test workflow
workflows: [ "Test K8 Operator" ]
types:
- completed
branches:
Expand All @@ -12,42 +12,88 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
# wait_for_tests:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# persist-credentials: false
# fetch-depth: 0
# - uses: lewagon/wait-on-check-action@v1.3.4
# with:
# check-name: examples-test
# ref: ${{ github.ref }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - uses: lewagon/wait-on-check-action@v1.3.4
# with:
# check-name: test-quickstart-no-mongodb
# ref: ${{ github.ref }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - uses: lewagon/wait-on-check-action@v1.3.4
# with:
# check-name: test-webui
# ref: ${{ github.ref }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - uses: lewagon/wait-on-check-action@v1.3.4
# with:
# check-name: sdk-test-local-memory (3.11)
# ref: ${{ github.ref }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - uses: lewagon/wait-on-check-action@v1.3.4
# with:
# check-name: sdk-test-local-memory (3.12)
# ref: ${{ github.ref }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - uses: lewagon/wait-on-check-action@v1.3.4
# with:
# check-name: test-webui-build
# ref: ${{ github.ref }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - uses: lewagon/wait-on-check-action@v1.3.4
# with:
# check-name: usage-service-test
# ref: ${{ github.ref }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}

rev_and_release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
fetch-depth: 0
- name: Increment version
id: increment_version
working-directory: k8s-operator
run: |
make increment-patch
- name: Get current version
id: get_version
run: echo "version=$(cat k8s-operator/VERSION)" >> $GITHUB_OUTPUT
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "bumping versions"
tagging_message: ${{ env.TAGGING_MESSAGE }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
cache-dependency-path: k8s-operator/go.sum
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: version
run: |
make -s -C scripts run "version_k8s"
echo K8_VERSION=$(node -p "require('./k8s-operator/env.json')['version']") >> $GITHUB_ENV
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Bump k8 version"
tagging_message: k8-op/${{ env.K8_VERSION }}
- name: "build"
run: make build docker-build docker-push
run: make build docker-buildx
working-directory: k8s-operator
- name: "bundle"
run: make bundle bundle-build bundle-push
working-directory: k8s-operator
- name: "catalog"
run: make catalog-build catalog-push
working-directory: k8s-operator
# - name: "catalog"
# run: make catalog-build catalog-push
# working-directory: k8s-operator
4 changes: 2 additions & 2 deletions examples/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "eidolon_examples"
version = "0.1.65"
version = "0.1.66"
description = ""
authors = [ "Luke Lalor <lukehlalor@gmail.com>",]
readme = "README.md"
Expand All @@ -14,13 +14,13 @@ line-length = 121

[tool.eidolon]
update-tag = "examples"
last-update-hash = "5159a21302654a851b3fa01906b8fd2018b9db70"
last-update-hash = "b7514b0f013f4df7b2d6a46347cbf793556d689c"

[tool.poetry.dependencies]
python = ">=3.11,<3.13"
setuptools = ">=69.0.2"
transformers = "^4.35.2"
eidolon-ai-sdk = "^0.1.89"
eidolon-ai-sdk = "^0.1.90"
eidolon-ai-client = "^0.1.27"
pydub = "^0.25.1"
ruamel-yaml = "^0.18.6"
Expand Down
28 changes: 17 additions & 11 deletions k8s-operator/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
define GetFromPkg
$(shell node -p "require('./env.json').$(1)")
endef

# VERSION defines the project version for the bundle.
# Update this value when you upgrade the version of your project.
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= $(call GetFromPkg,version)
VERSION ?= $(shell cat VERSION)

DEFAULT_CHANNEL ?= alpha
CHANNELS ?= alpha
Expand Down Expand Up @@ -40,7 +36,7 @@ IMAGE_TAG_BASE ?= eidolonai/controller

# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:$(VERSION)

# BUNDLE_GEN_FLAGS are the flags passed to the operator-sdk generate bundle command
BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
Expand Down Expand Up @@ -80,6 +76,8 @@ CONTAINER_TOOL ?= docker
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

UPDATE_VERSION ?= ./update_version

.PHONY: all
all: build

Expand All @@ -100,6 +98,18 @@ all: build
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

.PHONY: increment-patch
increment-patch: ## Increment the project version by a patch.
$(UPDATE_VERSION) patch

.PHONY: increment-minor
increment-minor:
$(UPDATE_VERSION) minor

.PHONY: increment-major
increment-major:
$(UPDATE_VERSION) major

##@ Development

.PHONY: manifests
Expand Down Expand Up @@ -273,10 +283,6 @@ bundle-build: ## Build the bundle image.
bundle-push: ## Push the bundle image.
$(MAKE) docker-push IMG=$(BUNDLE_IMG)

.PHONY: bundle-verify
bundle-push: ## Push the bundle image.
$(MAKE) docker-push IMG=$(BUNDLE_IMG)

.PHONY: opm
OPM = $(LOCALBIN)/opm
opm: ## Download opm locally if necessary.
Expand All @@ -299,7 +305,7 @@ endif
BUNDLE_IMGS ?= $(BUNDLE_IMG)

# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0).
CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:v$(VERSION)
CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:latest

# Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image.
ifneq ($(origin CATALOG_BASE_IMG), undefined)
Expand Down
1 change: 1 addition & 0 deletions k8s-operator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.20
2 changes: 1 addition & 1 deletion k8s-operator/config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: docker.io/eidolonai/controller
newTag: 0.0.3
newTag: 0.0.8
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ kind: Machine
metadata:
name: machine-sample
spec:
image: docker.io/eidolonai/sdk:0.1.88
image: docker.io/eidolonai/sdk:latest
imagePullPolicy: Always
envFrom:
- secretRef:
name: eidolon
Expand Down
13 changes: 13 additions & 0 deletions k8s-operator/config/samples/csv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: eidolon-catalog
namespace: operators
spec:
sourceType: grpc
image: eidolonai/controller-catalog:latest
displayName: Eidolon Catalog
publisher: dave@augustdata.ai
updateStrategy:
registryPoll:
interval: 10m
6 changes: 0 additions & 6 deletions k8s-operator/env.json

This file was deleted.

56 changes: 56 additions & 0 deletions k8s-operator/update_version
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

# Check if file and update type are provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <update_type>"
echo "Update type must be one of: major, minor, patch"
exit 1
fi

file=$(dirname $0)/VERSION
update_type=$1

# Validate update type
if [[ ! $update_type =~ ^(major|minor|patch)$ ]]; then
echo "Error: Update type must be one of: major, minor, patch"
exit 1
fi

# Source the version file to get the current version
VERSION=$(cat $file)

echo "$(cat $file)"

echo "Current version: $VERSION"

# Split version into components
IFS='.' read -ra version_parts <<< "$VERSION"
major=${version_parts[0]}
minor=${version_parts[1]}
patch=${version_parts[2]}

echo "Current version: $VERSION"

# Update version based on update type
case $update_type in
major)
major=$((major + 1))
minor=0
patch=0
;;
minor)
minor=$((minor + 1))
patch=0
;;
patch)
patch=$((patch + 1))
;;
esac

# Construct new version
new_version="$major.$minor.$patch"

# Update version file
echo "$new_version" > "$file"

echo "Version updated from $VERSION to $new_version"
2 changes: 1 addition & 1 deletion scripts/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f75c66b

Please sign in to comment.