forked from awslabs/gen-ai-evaluation-toolkit-on-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
224 lines (184 loc) · 6.6 KB
/
Copy pathmise.toml
File metadata and controls
224 lines (184 loc) · 6.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
[tools]
node = "22"
# Pin deliberately. mise's `latest` grabs whatever npm published most
# recently, so an upstream nx/aws-cdk release can break CI on unchanged
# code (nx@23.1.0 failed to resolve its linux-x64 native dep in CI on
# 2026-07-23). Keep these in lockstep with the workspace pins in the root
# package.json (nx) and packages/deployment (aws-cdk).
"npm:nx" = "22.7.6"
"npm:aws-cdk" = "2.1129.0"
python = "3.12"
# Used by smithy models
java = "corretto-17" # should work with other Java distributions, but we use the AWS by default
gradle = "8"
# Used to publish docker images
crane = "0.21"
jq = "1"
# Used by packages/terraform and packages/terraform-deployment
# Pin both deliberately. Terraform minor-version bumps can silently change
# resource defaults; tflint bumps can introduce new rules that retroactively
# fail CI on unchanged code. CI also pins tflint via TFLINT_VERSION in
# .gitlab/pipeline.yml — keep these in lockstep.
terraform = "1.14"
tflint = "0.63"
[env]
# Disable hatch/pip interactive TUI, they break nix's output
HATCH_INTERACTIVE = "false"
PIP_PROGRESS_BAR = "off"
# Disable pupeteer download in CDK
PUPPETEER_SKIP_DOWNLOAD = "true"
# Increase node allowed memory limit for js tests and linters
NODE_OPTIONS = "--max-old-space-size=4096"
# AWS region is intentionally NOT defaulted here — set it in your AWS
# profile or in mise.local.toml. Defaulting silently has burned us before
# (deployed to an arbitrary region the user wasn't expecting). The TF
# scripts under packages/terraform-deployment/scripts/ will fail loud with a clear
# message if AWS_DEFAULT_REGION / AWS_REGION are unset.
# packages/terraform: TF_VAR_project_name / TF_VAR_environment auto-populate
# the Terraform variables of the same name, so you do not need to edit tfvars
# per env. Override in mise.local.toml for your account.
#
# TF_ENV (environment segment in the deployed-image-tag SSM path and in
# the generated backend.hcl state key) is intentionally NOT set here:
# packages/terraform-deployment/scripts/common.sh defaults it to 'dev', and
# CI exports TF_ENV=tf-beta in .gitlab/pipeline.yml for historical continuity.
# Customers override TF_ENV=<their-env> in mise.local.toml. Committing a
# default here would shadow the CI export.
TF_VAR_project_name = "etk"
TF_VAR_environment = "dev"
[tasks.nx-refresh]
description = "Refresh nix packages cache"
run = '''
nx daemon --stop >/dev/null
'''
[tasks.nx-reset]
description = "Reset nix cache"
run = "nx reset >/dev/null"
[tasks.nx-ls]
description = "List all tracked packages in the monorepo"
run = "nx show projects | sort"
[tasks.install]
description = "Install base monorepo dependencies"
run = '''
# Install all workspace dependencies from root lock file
# Uses npm install (not ci) to tolerate missing generated packages before codegen
npm install
# Install hatch
./scripts/install-hatch.sh
'''
[tasks.install-all]
description = "Install dependencies for all packages"
run = '''
# Install monorepo dependencies (tolerates missing generated packages)
mise run install
# Generate clients, resolve workspace packages, build generated packages
mise run codegen
# Run package-specific install tasks (e.g. copy assets)
nx run-many --target=install --exclude='models,generated-*'
'''
[tasks.codegen]
description = "Generate code from smithy models and build generated packages"
run = '''
nx run-many --target=clean --projects='models,generated-*' --outputStyle static
nx run-many --target=build --projects='models,generated-*' --parallel 1 --outputStyle stream --nxBail
nx run-many --target=test --projects='models,generated-*' --outputStyle static
'''
[tasks.build]
description = "Build all packages (except models and generated code)"
run = "nx run-many --target=build,docker:build --exclude='models,generated-*'"
[tasks.test]
description = "Run all tests for all packages"
run = "nx run-many --target=test --exclude='models,generated-*'"
[tasks.clean]
description = "Clean all dependencies and build outputs"
run = '''
# Reset nix cache
nx reset >/dev/null
nx run-many --target=clean --outputStyle static
# Clean outputs
rm -rf output
'''
[tasks.clean-rebuild]
description = "Nuclear rebuild: reset NX cache, regenerate clients, reinstall and build everything"
run = '''
npm ci
nx reset
mise run codegen
nx run-many --target=install --exclude='models,generated-*'
nx run-many --target=build --exclude='models,generated-*' --parallel 1 --outputStyle stream
'''
[tasks.release]
description = "Builds the whole projects and runs its tests"
run = '''
mise run install
mise run codegen
mise run build
mise run test
'''
[tasks.sync-versions]
description = "Sync packages version number to that of the root package.json"
run = "./scripts/sync-version.sh"
[tasks.gen-pipeline]
description = "Regenerate .gitlab/generated/docker-plugin-matrix.yml from packages/terraform-deployment/plugins.yaml"
run = "npx --yes tsx packages/terraform-deployment/scripts/gen-pipeline.ts"
[tasks.publish]
description = "Publish packages to Gitlab registry"
run = '''
# Publish node and python packages
nx run-many --target=publish --parallel 1
# Publish docker images
IMAGES_TAG=$(jq -r '.version' ./package.json) ./scripts/publish/docker.sh ./output/images
'''
[tasks.audit-fix]
description = "Run npm audit fix across all node packages"
run = "nx run-many --target=audit:fix"
# === CI Tasks ===
[tasks.build-ci]
description = "Build packages for CI (excludes Docker images and deployment)"
run = '''
nx run-many --target=build \
--exclude='models,generated-*,deployment' \
--parallel 1 --outputStyle stream --nxBail
nx run-many --target=prepare-wheels
'''
[tasks.test-ci]
description = "Run tests for CI (excludes Docker packages and deployment)"
run = '''
nx run-many --target=test --exclude='models,generated-*,deployment'
'''
# === CDK Tasks ===
[tasks.bootstrap]
description = "Bootstrap CDK for your account"
dir = "{{ config_root }}/packages/deployment"
run = "npm run cdk:bootstrap"
[tasks.deploy]
description = "Deploy project to AWS"
dir = "{{ config_root }}/packages/deployment"
run = '''
nx build deployment
npm run cdk:deploy
'''
[tasks.destroy]
description = "Destroy CDK deployment"
dir = "{{ config_root }}/packages/deployment"
run = "npm run cdk:destroy"
# === Docs Tasks ===
[tasks."docs:serve"]
description = "Serve documentation locally with live reload"
run = '''
pip install -q -r docs/requirements.txt
npx typedoc
mkdocs serve
'''
[tasks."docs:build"]
description = "Build documentation to public/"
run = '''
pip install -q -r docs/requirements.txt
npx typedoc
mkdocs build --strict
'''
[settings]
# Do not echo task's command on execution
quiet = true
# Use precompiled Python binaries instead of building from source
python_compile = false