Skip to content

Commit 7a42eb0

Browse files
Increment arthur-engine version to 2.1.135 (#732)
2 parents 7109a20 + d9f7e1a commit 7a42eb0

File tree

423 files changed

+72390
-9930
lines changed

Some content is hidden

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

423 files changed

+72390
-9930
lines changed

.github/workflows/arthur-engine-workflow.yml

Lines changed: 132 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
branches:
1010
- main
1111
- dev
12+
workflow_dispatch:
13+
inputs:
14+
commit_sha:
15+
description: "Commit SHA for testing"
16+
required: false
17+
default: ""
18+
type: string
1219

1320
jobs:
1421
run-genai-engine-linter:
@@ -32,12 +39,33 @@ jobs:
3239
- uses: ./.github/workflows/composite-actions/setup-poetry
3340
with:
3441
working-directory: genai-engine
35-
- name: Run pre-commit
42+
with-groups: dev
43+
- name: Run isort
44+
id: isort
45+
continue-on-error: true
3646
run: |
37-
poetry -C genai-engine run pre-commit install
38-
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }})
39-
echo "$CHANGED_FILES" | xargs poetry -C genai-engine run pre-commit run --color always --verbose --files
40-
47+
poetry -C genai-engine run isort src --profile black --check
48+
- name: Run autoflake
49+
id: autoflake
50+
continue-on-error: true
51+
run: |
52+
poetry -C genai-engine run autoflake --remove-all-unused-imports --in-place --check --recursive --quiet src
53+
- name: Run black
54+
id: black
55+
continue-on-error: true
56+
run: |
57+
poetry -C genai-engine run black --check src
58+
# TODO: Uncomment this when mypy is fixed
59+
# - name: Run mypy
60+
# id: mypy
61+
# continue-on-error: true
62+
# run: |
63+
# poetry -C genai-engine run mypy src
64+
- name: Check linter results
65+
if: steps.isort.outcome == 'failure' || steps.autoflake.outcome == 'failure' || steps.black.outcome == 'failure'
66+
run: |
67+
echo "One or more linters failed"
68+
exit 1
4169
4270
run-ml-engine-linter:
4371
if: |
@@ -60,20 +88,39 @@ jobs:
6088
- uses: ./.github/workflows/composite-actions/setup-poetry
6189
with:
6290
working-directory: ml-engine
91+
with-groups: linters
6392
- name: Generate GenAI Client
6493
run: |
6594
pip install openapi-generator-cli[jdk4py]
6695
openapi-generator-cli generate -g python \
6796
-i ./genai-engine/staging.openapi.json \
6897
-o ./ml-engine/src/genai_client \
6998
--skip-validate-spec --package-name genai_client
70-
- name: Run linters
99+
- name: Run isort
100+
id: isort
101+
continue-on-error: true
71102
run: |
72-
poetry -C ml-engine install --with linters
73-
poetry -C ml-engine run autoflake --remove-all-unused-imports --in-place --recursive src/ml_engine
74-
poetry -C ml-engine run isort src/ml_engine --profile black
75-
poetry -C ml-engine run black src/ml_engine
76-
103+
poetry -C ml-engine run isort src/ml_engine --profile black --check
104+
- name: Run autoflake
105+
id: autoflake
106+
continue-on-error: true
107+
run: |
108+
poetry -C ml-engine run autoflake --remove-all-unused-imports --in-place --check --recursive --quiet src/ml_engine
109+
- name: Run black
110+
id: black
111+
continue-on-error: true
112+
run: |
113+
poetry -C ml-engine run black --check src/ml_engine
114+
- name: Run mypy
115+
id: mypy
116+
continue-on-error: true
117+
run: |
118+
poetry -C ml-engine run mypy src/ml_engine
119+
- name: Check linter results
120+
if: steps.isort.outcome == 'failure' || steps.autoflake.outcome == 'failure' || steps.black.outcome == 'failure' || steps.mypy.outcome == 'failure'
121+
run: |
122+
echo "One or more linters failed"
123+
exit 1
77124
78125
run-genai-engine-changelog-cop:
79126
if: |
@@ -98,6 +145,8 @@ jobs:
98145
curl -L -o "oasdiff.deb" https://github.com/Tufin/oasdiff/releases/download/v1.11.7/oasdiff_1.11.7_linux_amd64.deb
99146
dpkg -i oasdiff.deb
100147
- name: Generate changelog
148+
env:
149+
GENAI_ENGINE_SECRET_STORE_KEY: changeme_secret_store_key
101150
run: |
102151
export PYTHONPATH=src
103152
poetry -C genai-engine run generate_changelog
@@ -107,9 +156,9 @@ jobs:
107156
with:
108157
name: changelog-artifacts
109158
path: |
110-
new.openapi.json
111-
staging.openapi.json
112-
src/api_changelog.md
159+
genai-engine/new.openapi.json
160+
genai-engine/staging.openapi.json
161+
genai-engine/src/api_changelog.md
113162
114163
run-genai-engine-unit-tests:
115164
if: |
@@ -129,6 +178,8 @@ jobs:
129178
working-directory: genai-engine
130179
- name: Run unit tests
131180
shell: bash
181+
env:
182+
GENAI_ENGINE_SECRET_STORE_KEY: changeme_secret_store_key
132183
run: |
133184
set -o pipefail
134185
poetry -C genai-engine run pytest --cov --cov=genai-engine/src \
@@ -151,6 +202,48 @@ jobs:
151202
genai-engine/report.xml
152203
pytest-coverage.txt
153204
205+
run-genai-engine-alembic-migration-check:
206+
if: |
207+
(
208+
github.event_name == 'pull_request' ||
209+
(github.event_name == 'push' && github.ref_type == 'branch')
210+
)
211+
runs-on: ubuntu-latest
212+
container: python:3.12.9-bullseye
213+
services:
214+
postgres:
215+
image: postgres:15
216+
ports:
217+
- "5432:5432"
218+
env:
219+
POSTGRES_PASSWORD: changeme_pg_password
220+
POSTGRES_DB: arthur_genai_engine
221+
volumes:
222+
- postgres_data:/var/lib/postgresql/data
223+
steps:
224+
- uses: actions/checkout@v5
225+
with:
226+
fetch-depth: ${{ env.GIT_DEPTH }}
227+
- uses: ./.github/workflows/composite-actions/setup-git
228+
with:
229+
safe-directory: ${{ runner.workspace }}
230+
- uses: ./.github/workflows/composite-actions/setup-poetry
231+
with:
232+
working-directory: genai-engine
233+
- name: Run alembic migration check
234+
env:
235+
POSTGRES_USER: postgres
236+
POSTGRES_PASSWORD: changeme_pg_password
237+
POSTGRES_URL: postgres
238+
POSTGRES_PORT: 5432
239+
POSTGRES_DB: arthur_genai_engine
240+
POSTGRES_USE_SSL: false
241+
GENAI_ENGINE_SECRET_STORE_KEY: changeme_secret_store_key
242+
PYTHONPATH: "src:$PYTHONPATH"
243+
run: |
244+
cd genai-engine
245+
poetry run alembic upgrade head
246+
154247
run-ml-engine-unit-tests:
155248
if: |
156249
(
@@ -183,9 +276,13 @@ jobs:
183276
run: |
184277
poetry -C ml-engine run pytest
185278
186-
187279
build-genai-engine-docker-images:
188-
needs: [run-genai-engine-linter, run-genai-engine-changelog-cop, run-genai-engine-unit-tests]
280+
needs:
281+
[
282+
run-genai-engine-linter,
283+
run-genai-engine-changelog-cop,
284+
run-genai-engine-unit-tests,
285+
]
189286
environment: shared-protected-branch-secrets
190287
if: |
191288
contains(github.event.head_commit.message, 'Increment arthur-engine version to') &&
@@ -209,7 +306,7 @@ jobs:
209306
- name: Set up Docker Buildx
210307
uses: docker/setup-buildx-action@v3.11.1
211308
- name: Log in to Docker Hub
212-
uses: docker/login-action@v3.5.0
309+
uses: docker/login-action@v3.6.0
213310
with:
214311
username: ${{ secrets.DOCKER_HUB_USERNAME }}
215312
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
@@ -228,7 +325,6 @@ jobs:
228325
push: true
229326
platforms: linux/amd64
230327

231-
232328
build-ml-engine-docker-images:
233329
needs: [run-ml-engine-linter, run-ml-engine-unit-tests]
234330
environment: shared-protected-branch-secrets
@@ -255,7 +351,7 @@ jobs:
255351
--skip-validate-spec --package-name genai_client
256352
sed -i 's/license = "NoLicense"/license = "Unlicense"/g' ./ml-engine/src/genai_client/pyproject.toml
257353
- name: Log in to Docker Hub
258-
uses: docker/login-action@v3.5.0
354+
uses: docker/login-action@v3.6.0
259355
with:
260356
username: ${{ secrets.DOCKER_HUB_USERNAME }}
261357
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
@@ -289,7 +385,6 @@ jobs:
289385
docker push docker.arthur.ai/arthur/scope/ml-engine:latest-dev
290386
fi
291387
292-
293388
push-all-cfts:
294389
needs: [build-genai-engine-docker-images, build-ml-engine-docker-images]
295390
environment: shared-protected-branch-secrets
@@ -372,3 +467,20 @@ jobs:
372467
run: |
373468
git tag -a "${{ env.VERSION }}" -m "Create tag for Arthur Engine ${{ env.VERSION }}"
374469
git push origin "${{ env.VERSION }}"
470+
471+
deploy-genai-engine-cloudformation:
472+
needs: [push-tag]
473+
if: |
474+
contains(github.event.head_commit.message, 'Increment arthur-engine version to') &&
475+
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev')
476+
runs-on: ubuntu-latest
477+
container: node:20-alpine
478+
environment: shared-protected-branch-secrets
479+
steps:
480+
- name: Trigger GitLab Pipeline
481+
uses: fjogeleit/http-request-action@v1.16.5
482+
with:
483+
url: "https://gitlab.com/api/v4/projects/${{ secrets.GITLAB_PROJECT_ID }}/trigger/pipeline"
484+
method: POST
485+
contentType: application/x-www-form-urlencoded
486+
data: "token=${{ secrets.DEPLOY_TRIGGER_TOKEN }}&ref=main&variables[TRIGGER_JOB]=deploy_arthur_engine&variables[ARTHUR_ENGINE_COMMIT_SHA]=${{ inputs.commit_sha || github.sha }}"
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
name: 'Setup Poetry'
2-
description: 'Installs and configures Poetry'
1+
name: "Setup Poetry"
2+
description: "Installs and configures Poetry"
33

44
inputs:
55
working-directory:
6-
description: 'Directory containing the pyproject.toml file'
6+
description: "Directory containing the pyproject.toml file"
77
required: true
8+
with-groups:
9+
description: "Additional dependency groups to install (comma-separated)"
10+
required: false
11+
default: ""
812

913
runs:
10-
using: 'composite'
14+
using: "composite"
1115
steps:
12-
- name: 'Setup Poetry'
16+
- name: "Setup Poetry"
1317
shell: bash
1418
run: |
1519
pip install poetry
16-
poetry -C ${{ inputs.working-directory }} install
20+
GROUPS_FLAG=""
21+
if [ -n "${{ inputs.with-groups }}" ]; then
22+
GROUPS_FLAG="--with ${{ inputs.with-groups }}"
23+
fi
24+
poetry -C ${{ inputs.working-directory }} install $GROUPS_FLAG

.github/workflows/version-workflow.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
name: Version Management
22

33
on:
4+
push:
5+
branches:
6+
- dev
47
workflow_dispatch:
58
inputs:
69
intent:
7-
description: 'Trigger version bump'
10+
description: "Trigger version bump"
811
required: true
9-
default: 'bump_version'
12+
default: "bump_version"
1013
type: string
1114
bump_type:
12-
description: 'Version bump type (patch, minor, major)'
15+
description: "Version bump type (patch, minor, major)"
1316
required: true
14-
default: 'patch'
17+
default: "patch"
1518
type: choice
1619
options:
1720
- patch
@@ -21,7 +24,15 @@ on:
2124
jobs:
2225
bump-arthur-engine-version:
2326
environment: shared-protected-branch-secrets
24-
if: github.event_name == 'workflow_dispatch' && github.event.inputs.intent == 'bump_version' && github.ref != 'refs/heads/main'
27+
if: |
28+
(github.event_name == 'push' && github.ref == 'refs/heads/dev' &&
29+
!startsWith(github.event.head_commit.message, 'fix(deps)') &&
30+
!startsWith(github.event.head_commit.message, 'Increment arthur-engine') &&
31+
!startsWith(github.event.head_commit.message, 'Update dependency') &&
32+
!startsWith(github.event.head_commit.message, 'chore(deps)')) ||
33+
(github.event_name == 'workflow_dispatch' &&
34+
github.event.inputs.intent == 'bump_version' &&
35+
github.ref != 'refs/heads/main')
2536
runs-on: ubuntu-latest
2637
permissions:
2738
contents: write
@@ -56,7 +67,12 @@ jobs:
5667
run: |
5768
set -e
5869
59-
export BUMP_COMMAND="${{ github.event.inputs.bump_type }}"
70+
# For automatic triggers (push to dev), use patch. For manual triggers, use the user's choice
71+
if [ "${{ github.event_name }}" == "push" ]; then
72+
export BUMP_COMMAND="patch"
73+
else
74+
export BUMP_COMMAND="${{ github.event.inputs.bump_type }}"
75+
fi
6076
export BRANCH_NAME="arthur-engine-version-bump/$(date +%Y%m%d-%H%M%S)"
6177
# git checkout -b $BRANCH_NAME
6278
@@ -70,7 +86,7 @@ jobs:
7086
MAJOR=${VERSION_PARTS[0]}
7187
MINOR=${VERSION_PARTS[1]}
7288
PATCH=${VERSION_PARTS[2]}
73-
89+
7490
# Bump version based on command
7591
case "$BUMP_COMMAND" in
7692
"major")
@@ -118,12 +134,12 @@ jobs:
118134
sed -i "s|version:.*|version: $NEW_ARTHUR_ENGINE_VERSION|" "$GENAI_ENGINE_HELM_CHART_YAML_PATH"
119135
sed -i "s|appVersion:.*|appVersion: $NEW_ARTHUR_ENGINE_VERSION|" "$GENAI_ENGINE_HELM_CHART_YAML_PATH"
120136
sed -i "s|genaiEngineVersion:.*|genaiEngineVersion: '$NEW_ARTHUR_ENGINE_VERSION'|" "$GENAI_ENGINE_HELM_VALUES_YAML_PATH"
121-
137+
122138
# Include the ml-engine Chart.yaml and values.yaml
123139
sed -i "s|version:.*|version: $NEW_ARTHUR_ENGINE_VERSION|" "$ML_ENGINE_CHART_YAML_PATH"
124140
sed -i "s|appVersion:.*|appVersion: $NEW_ARTHUR_ENGINE_VERSION|" "$ML_ENGINE_CHART_YAML_PATH"
125141
sed -i "s|containerImageVersion:.*|containerImageVersion: \"$NEW_ARTHUR_ENGINE_VERSION\"|" "$ML_ENGINE_VALUES_YAML_PATH"
126-
142+
127143
# Update the genai and ml engine pyproject.toml files and the openapi json
128144
sed -i "s/^version = \".*\"/version = \"$NEW_ARTHUR_ENGINE_VERSION\"/" genai-engine/pyproject.toml
129145
sed -i "s/\"version\": \".*\"/\"version\": \"$NEW_ARTHUR_ENGINE_VERSION\"/" genai-engine/staging.openapi.json

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ __pycache__
1313
*.egg-info
1414
build/
1515

16+
# Node.js
17+
node_modules/
18+
package-lock.json
19+
1620
.html_cov*
1721
.coverage*
1822
coverage.xml

0 commit comments

Comments
 (0)