Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use new-style env command #101

Open
wants to merge 122 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
d8e75cd
feat(scripts): support specify yatai endpoint
yetone Dec 27, 2022
15ab033
fix(scripts): set YATAI_ENDPOINT to empty string
yetone Dec 28, 2022
7f61c61
fix: some fields optional
yetone Jan 4, 2023
1d798c5
feat: add e2e tests
yetone Jan 4, 2023
8537127
fix(tests): fix env name
yetone Jan 4, 2023
de873b4
fix(tests): mark spec as failure
yetone Jan 4, 2023
0733f8d
fix(tests): fix e2e test
yetone Jan 4, 2023
33b43d3
fix(tests): fix e2e example
yetone Jan 4, 2023
af12b23
fix(scripts): fix quick install
yetone Jan 4, 2023
b7a2ffc
fix: get yatai image builder namespace
yetone Jan 4, 2023
9fcba10
fix: fix e2e test
yetone Jan 4, 2023
eb4f5ba
fix: fix e2e test
yetone Jan 5, 2023
c465578
fix: AWS_EC2_METADATA_DISABLED
yetone Jan 5, 2023
1d7c393
feat: add yatai-image-builder-crds helm chart
yetone Jan 5, 2023
171ee6d
fix(ci): release yatai-image-builder-crds
yetone Jan 6, 2023
4dc695c
feat: support bento image build engines: buildkit and buildkit-rootless
yetone Jan 8, 2023
337f26f
feat: add rbac for yatai with yatai-image-builder
yetone Jan 8, 2023
bccd922
feat: support upgrade image builder pod
yetone Jan 12, 2023
7aeef0d
fix(scripts): cannot install devel crds
yetone Jan 16, 2023
6bdb942
feat: add image field for bento request crd
yetone Jan 17, 2023
8eea644
fix(helm-chart): minimize role
yetone Jan 15, 2023
ea82e2b
fix: use the docker credentials from the specified dockerConfigJsonSe…
yetone Jan 17, 2023
93f1cb9
fix(scripts): make sure cert-manager pod created in quick install script
yetone Feb 13, 2023
5d576dd
chore(deps): bump golang.org/x/net from 0.1.0 to 0.7.0
dependabot[bot] Feb 18, 2023
fef4dd4
fix(doc): typo
yetone Feb 24, 2023
b8dc2a7
fix: fix the logic of checking if the image exists
yetone Mar 27, 2023
73c4d8b
fix: update dependencies
yetone Apr 19, 2023
253a7f5
fix: golangci lint
yetone Apr 19, 2023
3edc88f
fix: update dependencies
yetone Apr 19, 2023
0644cfb
allow setting yataiSystem.serviceAccountName in install script (#21)
sauyon May 9, 2023
628df75
fix: disable report failed when builder pod is failed
yetone May 25, 2023
2b3f677
Feat: add disable yatai registration env in helm chart (#23)
FogDong Jun 8, 2023
dbdfc44
feat: increase downlader container resources
yetone Jul 6, 2023
3a2dbdc
fix: move yatai registration env to secret env (#24)
FogDong Jul 7, 2023
cbf02cf
refactor: use random pod names to avoid events from the previous pod …
yetone Jul 20, 2023
53f2bdf
feat: default resources for builder container
yetone Jul 26, 2023
d8c399a
fix: gofmt
yetone Jul 26, 2023
e4e7b54
feat: add global default_image_builder_container_resources configurat…
yetone Aug 4, 2023
90f60be
feat: add priorityClassName (#29)
yetone Aug 4, 2023
6cf4ac3
feat: support specify AWSAccessKeySecretName
yetone Aug 15, 2023
cabf9d2
feat: get hash str
yetone Aug 15, 2023
3d7dac1
fix: delete duplicate pods
yetone Aug 17, 2023
9edfdb5
fix: global default image builder container resources
yetone Aug 17, 2023
d21712c
chores: add pod deletion logs
yetone Aug 17, 2023
f07bb16
refactor: change yaml package (#33)
yetone Aug 25, 2023
f270c5a
chore(ci): setup upterm session
yetone Aug 25, 2023
33d4dbb
refactor: use job instead of pod (#31)
yetone Aug 26, 2023
6f26996
fix: use default backoffLimit (#35)
yetone Aug 30, 2023
607c302
fix: add namespace in image name (#36)
FogDong Aug 31, 2023
267c40b
feat: add image builder pod failed events (#37)
yetone Sep 2, 2023
48a883a
feat: set not available if image builder pod failed (#38)
yetone Sep 2, 2023
f112f46
feat: add secrets access permission for yatai (#39)
yetone Sep 4, 2023
d241835
fix: yatai cannot create secret (#40)
yetone Sep 5, 2023
84f8d4b
feat: remove default image builder resources (#32)
sauyon Sep 8, 2023
208917f
feat: separate models (#34)
yetone Sep 18, 2023
4c31c0d
feat: model seeder supports node selectors (#41)
yetone Sep 19, 2023
4935b21
fix: delete old model seeder jobs (#42)
yetone Sep 21, 2023
fd03c60
fix: set err to nil (#43)
yetone Sep 21, 2023
3e7efc9
fix: rate limiter (#44)
yetone Sep 21, 2023
d0d1a6f
fix: fix the logic of checking if the image building job is successfu…
yetone Oct 13, 2023
4f1fe36
fix: the image name cannot exceed 128 characters (#46)
yetone Oct 19, 2023
73eaef4
fix: the image name cannot exceed 128 characters
yetone Oct 19, 2023
6590b0b
fix: image tag length (#47)
yetone Oct 19, 2023
950d1e9
feat: support specify juicefs storage class name
yetone Oct 31, 2023
53fef0b
feat: JUICEFS_STORAGE_CLASS_NAME
yetone Oct 31, 2023
f3c2aab
feat: storage class name as a part of pvc name
yetone Oct 31, 2023
24dbdfb
fix: check model exists
yetone Nov 1, 2023
5ff05f0
feat: force build image (#50)
yetone Nov 16, 2023
0775687
feat: add image exists checked condition (#52)
yetone Nov 23, 2023
569634a
feat: rebuild separate models images (#53)
yetone Nov 23, 2023
8e6992b
feat: buildkit engine support s3 cache backend (#51)
yetone Nov 23, 2023
24e4fac
fix: reubild for normal images (#54)
yetone Nov 23, 2023
436081d
feat: add build multi arch kaniko image command
yetone Nov 29, 2023
cd445da
fix: check ecr image logic (#55)
wellshs Dec 18, 2023
1e4c83e
fix: wrong ecr image check logic (#56)
Dec 19, 2023
07fb769
feat: add service name in bento and bentorequest (#58)
FogDong Jan 12, 2024
ec0b639
feat: support estargz (#59)
yetone Jan 18, 2024
6a4a2e9
chore: support image name prefix
bojiang Feb 8, 2024
9a14cf4
iterate
bojiang Feb 8, 2024
0ae48e4
fmt
bojiang Feb 8, 2024
e4989e8
Merge pull request #60 from bentoml/jiang-dev
bojiang Feb 8, 2024
422cb70
fix: flashing image build status (#61)
yetone Feb 22, 2024
c9bcc7b
feat: support build args (#62)
yetone Mar 1, 2024
a403b67
fix: quoted cmd args (#64)
yetone Mar 21, 2024
9349012
refactor: refine model prefix (#63)
yetone Mar 22, 2024
9133345
fix: specify kaniko cache repo (#65)
yetone Mar 25, 2024
d4ab40b
feat: add kaniko cache repo helm value (#66)
yetone Mar 25, 2024
47c6f2f
feat: try to deploy the model seeder and image builder for the same b…
yetone Apr 18, 2024
e99d38a
feat: add retry for kaniko (#70)
yetone May 2, 2024
57ab4e1
feat: restart if has new helm release
yetone May 14, 2024
3e4d9ef
Merge pull request #71 from bentoml/feat/restart-if-has-new-helm-release
FogDong May 14, 2024
2be92e4
fix: remove url in logs (#72)
yetone May 29, 2024
cc9d5ba
feat: add gcs support (#73)
FogDong Jun 4, 2024
5bbc5ff
feat: support kaniko snapshot mode (#74)
yetone Jun 6, 2024
47cfd27
fix: use buildkit to build stargz image (#75)
yetone Jul 8, 2024
c865415
feat: support registry cache for buildkit (#76)
yetone Jul 8, 2024
4c9f2f5
fix: remove kaniko --image-download-retry option because of the lates…
yetone Jul 16, 2024
6761ac2
feat: enable service monitor to pick up metrics (#78)
Haivilo Jul 23, 2024
45af9ef
fix: port name when using multiple ports (#79)
Haivilo Jul 25, 2024
5b2f901
fix: do not use loopback ip for metrics endpoint (#80)
Haivilo Jul 26, 2024
579bbed
feat: support seeding model from Huggingface repo (#81)
rickzx Aug 14, 2024
fd213e8
feat: use zstd to compress image layer (#82)
yetone Aug 14, 2024
7dee30f
feat: use zstd to compress image layer (#83)
yetone Aug 15, 2024
717926a
chore: refine code (#84)
yetone Aug 15, 2024
3d40e3c
feat: hash str for different jobs (#85)
yetone Aug 15, 2024
decbb4b
fix: do not requeue (#86)
yetone Aug 16, 2024
c5fe069
fix: golint (#87)
yetone Aug 16, 2024
c3d1807
fix: add -f for mv (#88)
FogDong Aug 19, 2024
ec60da2
fix: fix reconcile and use rsync (#89)
FogDong Aug 19, 2024
1ee808e
fix: reconcile BentoRequestConditionTypeBentoAvailable condition (#91)
yetone Aug 22, 2024
8cc215e
fix: fix hf model mount path (#92)
FogDong Aug 29, 2024
bd57b22
fix: fix url script (#96)
FogDong Aug 29, 2024
efb37e4
fix: use model id in download url for hf model (#97)
FogDong Aug 30, 2024
02bc175
fix: use revision instead of model version (#98)
FogDong Aug 30, 2024
9bd1639
chore(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#95)
dependabot[bot] Sep 3, 2024
413bc73
chore(deps): bump google.golang.org/protobuf from 1.28.1 to 1.33.0 (#93)
dependabot[bot] Sep 3, 2024
90bb20e
chore(deps): bump github.com/docker/distribution from 2.7.1+incompati…
dependabot[bot] Sep 3, 2024
236d561
chore: update golang net vendor
FogDong Sep 3, 2024
5c45e78
fix: fix gsutil path
FogDong Sep 6, 2024
9ea9776
fix: fix gsutil path
sauyon Sep 6, 2024
bdb12c5
chore: update golang/net
sauyon Sep 6, 2024
b0bdb48
fix: use new-style env command
sauyon Sep 6, 2024
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
234 changes: 234 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
name: e2e
on:
issue_comment:
types: [created]

env:
E2E_CHECK_NAME: e2e tests

jobs:
triage:
runs-on: ubuntu-latest
name: Comment evaluate
outputs:
run-e2e: ${{ startsWith(github.event.comment.body,'/run-e2e') && steps.checkUserMember.outputs.isTeamMember == 'true' }}
is-debug: ${{ startsWith(github.event.comment.body,'/run-e2e debug') && steps.checkUserMember.outputs.isTeamMember == 'true' }}
pr_num: ${{ steps.parser.outputs.pr_num }}
image_tag: "pr-${{ steps.parser.outputs.pr_num }}-${{ steps.parser.outputs.commit_sha }}"
commit_sha: ${{ steps.parser.outputs.commit_sha }}
version_buildflags: ${{ steps.parser.outputs.version_buildflags }}
image_build_hash: ${{ steps.parser.outputs.image_build_hash }}

steps:
- uses: actions/checkout@v3

- uses: tspascoal/get-user-teams-membership@v2
id: checkUserMember
with:
username: ${{ github.actor }}
team: 'dev'
GITHUB_TOKEN: ${{ secrets.GH_CHECKING_USER_AUTH }}

- name: Update comment with the execution url
if: ${{ startsWith(github.event.comment.body,'/run-e2e') && steps.checkUserMember.outputs.isTeamMember == 'true' }}
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ github.event.comment.id }}
body: |
**Update:** You can check the progress [here](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})
reactions: rocket

- name: Parse git info
if: ${{ startsWith(github.event.comment.body,'/run-e2e') && steps.checkUserMember.outputs.isTeamMember == 'true' }}
id: parser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get PR number
PR_URL="${{ github.event.issue.pull_request.url }}"
PR_NUM=${PR_URL##*/}
echo "Checking out from PR #$PR_NUM based on URL: $PR_URL"
echo "::set-output name=pr_num::$PR_NUM"
# Get commit SHA
git config --global --add safe.directory "$GITHUB_WORKSPACE"
gh pr checkout $PR_NUM
SHA=$(git log -n 1 --pretty=format:"%H")
echo "::set-output name=commit_sha::$SHA"
GIT_COMMIT=$(git describe --match=NeVeRmAtCh --tags --always --dirty | cut -c 1-7)
BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
VERSION=$(git describe --tags `git rev-list --tags --max-count=1` | sed 's/v\(\)/\1/')
PKG=github.com/bentoml/yatai-image-builder
VERSION_BUILDFLAGS="-X '${PKG}/version.GitCommit=${GIT_COMMIT}' -X '${PKG}/version.Version=${VERSION}' -X '${PKG}/version.BuildDate=${BUILD_DATE}'"
echo "::set-output name=version_buildflags::$VERSION_BUILDFLAGS"
echo "::set-output name=image_build_hash::${{ hashFiles('Dockerfile', 'main.go', './apis/**', './controllers/**', './utils/**', './version/**', './yatai-client/**', '**/go.sum', '**go.mod') }}"

build-test-images:
needs: triage
if: needs.triage.outputs.run-e2e == 'true'
runs-on: ubuntu-latest
steps:
- name: Set status in-progress
uses: LouisBrunner/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ needs.triage.outputs.commit_sha }}
name: ${{ env.E2E_CHECK_NAME }}
status: in_progress
details_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

- uses: actions/checkout@v3

- name: Register workspace path
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Checkout Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: checkout
run: |
gh pr checkout ${{ needs.triage.outputs.pr_num }}

- name: Set up Docker Buildx
id: buildx
# Use the action from the master, as we've seen some inconsistencies with @v1
# Issue: https://github.com/docker/build-push-action/issues/286
uses: docker/setup-buildx-action@master
with:
install: true

- name: Login to Quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
# Key is named differently to avoid collision
key: ${{ runner.os }}-multi-buildx-${{ needs.triage.outputs.image_build_hash }}
restore-keys: |
${{ runner.os }}-multi-buildx

- name: Build test image
uses: docker/build-push-action@v2
with:
build-args: 'VERSION_BUILDFLAGS=${{ needs.triage.outputs.version_buildflags }}'
context: .
push: true
tags: quay.io/bentoml/test-yatai-image-builder:${{ needs.triage.outputs.image_tag }}
cache-from: type=local,src=/tmp/.buildx-cache
# Note the mode=max here
# More: https://github.com/moby/buildkit#--export-cache-options
# And: https://github.com/docker/buildx#--cache-tonametypetypekeyvalue
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

run-test:
needs: [triage, build-test-images]
if: needs.triage.outputs.run-e2e == 'true'
runs-on: ubuntu-latest
steps:
- name: Set status in-progress
uses: LouisBrunner/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ needs.triage.outputs.commit_sha }}
name: ${{ env.E2E_CHECK_NAME }}
status: in_progress
details_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

- name: Checkout
uses: actions/checkout@v3

- name: Register workspace path
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Checkout Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: checkout
run: |
gh pr checkout ${{ needs.triage.outputs.pr_num }}

- name: Install KinD
run: ./tests/gh-actions/install_kind.sh

- name: Install Helm
run: ./tests/gh-actions/install_helm.sh

- name: Create KinD Cluster
run: kind create cluster --config tests/gh-actions/kind-cluster-1-24.yaml

- uses: oNaiPs/secrets-to-env-action@v1
with:
secrets: ${{ toJSON(secrets) }}

- name: Install yatai-image-builder
continue-on-error: true
id: install-yatai-image-builder
env:
YATAI_IMAGE_BUILDER_IMG_REPO: test-yatai-image-builder
YATAI_IMAGE_BUILDER_IMG_TAG: ${{ needs.triage.outputs.image_tag }}
run: |
./tests/e2e/installation_test.sh

- name: Setup upterm session
uses: lhotari/action-upterm@v1
if: needs.triage.outputs.is-debug == 'true'
with:
## limits ssh access and adds the ssh public key for the user which triggered the workflow
limit-access-to-actor: true
## limits ssh access and adds the ssh public keys of the listed GitHub users
limit-access-to-users: yetone

- name: Run e2e test
continue-on-error: true
id: test
if: steps.install-yatai-image-builder.outcome == 'success'
env:
DEBUG: ${{ needs.triage.outputs.is-debug }}
run: |
make test-e2e

- name: Set status success
uses: LouisBrunner/[email protected]
if: steps.test.outcome == 'success' && steps.install-yatai-image-builder.outcome == 'success'
with:
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ needs.triage.outputs.commit_sha }}
name: ${{ env.E2E_CHECK_NAME }}
conclusion: success
details_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

- name: React to comment with success
uses: dkershner6/reaction-action@v1
if: steps.test.outcome == 'success' && steps.install-yatai-image-builder.outcome == 'success'
with:
token: ${{ secrets.GITHUB_TOKEN }}
commentId: ${{ github.event.comment.id }}
reaction: "hooray"

- name: React to comment with failure
uses: dkershner6/reaction-action@v1
if: steps.test.outcome != 'success' || steps.install-yatai-image-builder.outcome != 'success'
with:
token: ${{ secrets.GITHUB_TOKEN }}
commentId: ${{ github.event.comment.id }}
reaction: "confused"

- name: Set status failure
uses: LouisBrunner/[email protected]
if: steps.test.outcome != 'success' || steps.install-yatai-image-builder.outcome != 'success'
with:
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ needs.triage.outputs.commit_sha }}
name: ${{ env.E2E_CHECK_NAME }}
conclusion: failure
details_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
6 changes: 5 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ jobs:
- name: Set up chart-testing
uses: helm/[email protected]

- name: Render Helm Template
- name: Render yatai-image-builder-crds Helm Template
working-directory: ./helm/yatai-image-builder-crds
run: make template

- name: Render yatai-image-builder Helm Template
working-directory: ./helm/yatai-image-builder
run: make template
20 changes: 18 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,31 @@ jobs:
echo ::set-output name=match::true
fi

- name: Package, Index and Publish to public repo
- name: Package, Index and Publish yatai-image-builder-crds to public repo
working-directory: ./helm/yatai-image-builder-crds
if: steps.check-tag.outputs.match != 'true'
env:
VERSION: ${{ steps.tag.outputs.tag }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: make release

- name: Package, Index and Publish yatai-image-builder-crds to devel repo
working-directory: ./helm/yatai-image-builder-crds
if: steps.check-tag.outputs.match == 'true'
env:
VERSION: ${{ steps.tag.outputs.tag }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: make release-devel

- name: Package, Index and Publish yatai-image-builder to public repo
working-directory: ./helm/yatai-image-builder
if: steps.check-tag.outputs.match != 'true'
env:
VERSION: ${{ steps.tag.outputs.tag }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: make release

- name: Package, Index and Publish to devel repo
- name: Package, Index and Publish yatai-image-builder to devel repo
working-directory: ./helm/yatai-image-builder
if: steps.check-tag.outputs.match == 'true'
env:
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-kaniko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM gcr.io/kaniko-project/executor:debug
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ help: ## Display this help.
.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(KUSTOMIZE) build config/crd > helm/yatai-image-builder-crds/templates/bentorequest.yaml

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand All @@ -112,6 +113,10 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out

.PHONY: test-e2e # You will need to have a Kind cluster up in running to run this target
test-e2e:
go test ./tests/e2e/ -v -ginkgo.v -timeout 20m

##@ Build

.PHONY: build
Expand Down Expand Up @@ -167,7 +172,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.9.2
CONTROLLER_TOOLS_VERSION ?= v0.14.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand Down Expand Up @@ -250,3 +255,6 @@ start-dev:

stop-dev:
kubectl -n yatai-image-builder patch deploy/yatai-image-builder -p '{"spec":{"replicas":1}}'

build-kaniko-image:
docker buildx build --platform linux/amd64,linux/arm64 -t quay.io/bentoml/kaniko:debug -f Dockerfile-kaniko --push .
14 changes: 9 additions & 5 deletions apis/resources/v1alpha1/bento_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand All @@ -35,8 +36,9 @@ type BentoContext struct {

type BentoModel struct {
// +kubebuilder:validation:Required
Tag string `json:"tag"`
DownloadURL string `json:"downloadUrl,omitempty"`
Tag string `json:"tag"`
DownloadURL string `json:"downloadUrl,omitempty"`
Size *resource.Quantity `json:"size,omitempty"`
}

type BentoRunner struct {
Expand All @@ -54,9 +56,11 @@ type BentoSpec struct {
// +kubebuilder:validation:Required
Tag string `json:"tag"`
// +kubebuilder:validation:Required
Image string `json:"image"`
Context BentoContext `json:"context,omitempty"`
Runners []BentoRunner `json:"runners,omitempty"`
Image string `json:"image"`
ServiceName string `json:"serviceName,omitempty"`
Context *BentoContext `json:"context,omitempty"`
Runners []BentoRunner `json:"runners,omitempty"`
Models []BentoModel `json:"models,omitempty"`

ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
}
Expand Down
Loading
Loading