This repository has been archived by the owner on Jul 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from defenseunicorns/create-lfai-api-zarf-package
Create LFAI-api Zarf package
- Loading branch information
Showing
22 changed files
with
409 additions
and
42 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: Run tests | ||
on: [push, pull_request] | ||
on: [pull_request] | ||
|
||
jobs: | ||
Run-Tests: | ||
|
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,40 @@ | ||
name: Publish Artifacts | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
zarf: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login to Registry1 | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: registry1.dso.mil | ||
username: ${{ secrets.REGISTRY1_USERNAME }} | ||
password: ${{ secrets.REGISTRY1_PASSWORD }} | ||
|
||
- name: Build API Image | ||
run: make docker-build docker-push VERSION=$GITHUB_REF_NAME | ||
|
||
- name: Install Zarf | ||
uses: defenseunicorns/setup-zarf@main | ||
|
||
- name: Build Zarf Package | ||
run: zarf package create . --confirm | ||
|
||
- name: Publish Zarf Package | ||
run: zarf package publish zarf-package-*.zst oci://ghcr.io/defenseunicorns/packages |
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 |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
leapfrogai_api.egg-info | ||
__pycache__ | ||
.vscode | ||
config.yaml | ||
config.yaml | ||
*.tar.zst | ||
.python-version |
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,24 @@ | ||
apiVersion: v2 | ||
name: leapfrogai | ||
description: A deployment of AI tools | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.4.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "1.16.0" |
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,68 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: api-deployment | ||
spec: | ||
replicas: {{ .Values.api.replcias }} | ||
strategy: | ||
type: Recreate | ||
selector: | ||
matchLabels: | ||
app: api | ||
template: | ||
metadata: | ||
labels: | ||
app: api | ||
spec: | ||
serviceAccountName: read-configmaps | ||
containers: | ||
- name: sidecar | ||
image: registry1.dso.mil/ironbank/kiwigrid/k8s-sidecar:{{ .Values.image.kiwigridTag }} | ||
volumeMounts: | ||
- name: api-model | ||
mountPath: /config/ | ||
env: | ||
- name: LABEL | ||
value: "leapfrogai" | ||
- name: FOLDER | ||
value: /config/ | ||
- name: RESOURCE | ||
value: both | ||
- name: UNIQUE_FILENAMES | ||
value: "true" | ||
- name: NAMESPACE | ||
value: leapfrogai | ||
- name: api-container | ||
image: ghcr.io/defenseunicorns/leapfrogai-api:{{ .Values.image.lfaiAPITag }} | ||
imagePullPolicy: Always | ||
env: | ||
- name: LFAI_CONFIG_PATH | ||
value: /config/ | ||
- name: LFAI_CONFIG_FILENAME | ||
value: "*.toml" | ||
- name: PORT | ||
value: "{{ .Values.api.port }}" | ||
ports: | ||
- containerPort: 8080 | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8080 | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8080 | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
volumeMounts: | ||
- name: api-model | ||
mountPath: /config | ||
volumes: | ||
- name: api-model | ||
emptyDir: {} | ||
|
||
|
||
|
||
|
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,31 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: read-configmaps | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: read-configmaps | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
- secrets | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: read-configmaps | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: read-configmaps | ||
subjects: | ||
- kind: ServiceAccount | ||
name: read-configmaps |
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,18 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: api | ||
annotations: | ||
zarf.dev/connect-description: "Load the OpenAPI spec for the LFAI API" | ||
zarf.dev/connect-url: "/docs" | ||
labels: | ||
zarf.dev/connect-name: lfai-api | ||
spec: | ||
selector: | ||
app: api | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 8080 | ||
targetPort: 8080 | ||
type: ClusterIP |
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,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
istio-injection: {{ .Values.istio.injection }} | ||
name: leapfrogai |
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,18 @@ | ||
{{- if .Values.istio.enabled }} | ||
apiVersion: networking.istio.io/v1beta1 | ||
kind: VirtualService | ||
metadata: | ||
name: leapfrogai | ||
spec: | ||
gateways: | ||
- istio-system/{{ .Values.istio.gateway }} | ||
hosts: | ||
- leapfrogai.{{ .Values.domain }} | ||
http: | ||
- route: | ||
- destination: | ||
host: api | ||
port: | ||
number: 8080 | ||
{{- end }} | ||
--- |
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,17 @@ | ||
domain: bigbang.dev | ||
|
||
image: | ||
lfaiAPITag: 0.1.2 | ||
kiwigridTag: 1.23.3 | ||
|
||
istio: | ||
enabled: false | ||
gateway: tenant | ||
injection: disabled | ||
|
||
api: | ||
replicas: 1 | ||
port: 8080 | ||
|
||
monitoring: | ||
enabled: false |
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 @@ | ||
domain: ###ZARF_VAR_DOMAIN### | ||
|
||
image: | ||
lfaiAPITag: ###ZARF_CONST_LEAPFROGAI_API_VERSION### | ||
kiwigridTag: ###ZARF_CONST_KIWIGRID_VERSION### | ||
|
||
istio: | ||
enabled: ###ZARF_VAR_ISTIO_ENABLED### | ||
gateway: ###ZARF_VAR_ISTIO_GATEWAY### | ||
injection: ###ZARF_VAR_ISTIO_INJECTION### |
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
Oops, something went wrong.