Skip to content

Commit 480cda9

Browse files
committed
circleci: update to aotuai/brainframe-cli-env-20.04:4bbabb5 aotuai/test-ubuntu-20.04:7d3e7d
1 parent fa85da8 commit 480cda9

1 file changed

Lines changed: 99 additions & 27 deletions

File tree

.circleci/config.yml

Lines changed: 99 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,27 @@ parameters:
44
poetry-version:
55
type: string
66
default: "1.8.3"
7+
old-poetry-version:
8+
type: string
9+
default: "1.1.14"
10+
py36-tag:
11+
type: string
12+
default: "py36"
13+
py38-tag:
14+
type: string
15+
default: "py38"
16+
py310-tag:
17+
type: string
18+
default: "py310.py312"
719

820

921
executors:
1022
focal:
1123
docker:
12-
- image: aotuai/brainframe-cli-env-20.04:7d3e7d
24+
- image: aotuai/brainframe-cli-env-20.04:4bbabb5--no-cache
1325
bionic:
1426
docker:
15-
- image: aotuai/brainframe-cli-env-18.04:7d3e7d
27+
- image: aotuai/brainframe-cli-env-18.04:4bbabb5--no-cache
1628

1729

1830
workflows:
@@ -35,6 +47,14 @@ workflows:
3547
matrix:
3648
parameters:
3749
os: [bionic, focal]
50+
poetry-version:
51+
- << pipeline.parameters.old-poetry-version >>
52+
- << pipeline.parameters.poetry-version >>
53+
exclude:
54+
- os: bionic
55+
poetry-version: << pipeline.parameters.poetry-version >>
56+
- os: focal
57+
poetry-version: << pipeline.parameters.old-poetry-version >>
3858
- test-installation-deb:
3959
requires:
4060
- build-deb
@@ -121,27 +141,40 @@ jobs:
121141
parameters:
122142
os:
123143
type: executor
144+
poetry-version:
145+
type: string
124146
executor: << parameters.os >>
125147
steps:
126-
- run: apt-get update
127-
- run: apt-get install -y software-properties-common dpkg-dev devscripts equivs python3-pip
128-
- run: add-apt-repository -y ppa:jyrki-pulliainen/dh-virtualenv
129-
- run: apt-get install -y dh-virtualenv
130-
- install-poetry
148+
- install-poetry:
149+
poetry-version: << parameters.poetry-version >>
131150
- checkout
151+
- run:
152+
command: |
153+
case "$CIRCLE_JOB" in
154+
*bionic*)
155+
echo 'export PY_TAG="<< pipeline.parameters.py36-tag >>"' >> $BASH_ENV
156+
;;
157+
*focal*)
158+
echo 'export PY_TAG="<< pipeline.parameters.py38-tag >>"' >> $BASH_ENV
159+
;;
160+
*)
161+
echo 'export PY_TAG="<< pipeline.parameters.py310-tag >>"' >> $BASH_ENV
162+
;;
163+
esac
164+
source $BASH_ENV
132165
- run:
133166
working_directory: ~/project/
134167
command: |
135-
cp -r package/debian .
136-
cp package/setup.py .
137-
cp package/system_package_defaults.yaml brainframe/cli/defaults.yaml
138-
cp deployment/pyproject.toml.py310.py312 pyproject.toml
139-
cp deployment/poetry.lock.py310.py312 poetry.lock
168+
cp -r package/debian .
169+
cp package/setup.py .
170+
cp package/system_package_defaults.yaml brainframe/cli/defaults.yaml
171+
cp deployment/pyproject.toml.${PY_TAG} pyproject.toml
172+
cp deployment/poetry.lock.${PY_TAG} poetry.lock
140173
- run:
141174
working_directory: ~/project/
142175
command: |
143-
mk-build-deps --install debian/control
144-
poetry export --output requirements.txt
176+
mk-build-deps --install debian/control
177+
poetry export --output requirements.txt
145178
- run: dpkg-buildpackage --unsigned-source --unsigned-changes --build=binary
146179
- run: mkdir dist
147180
- run: |
@@ -155,25 +188,27 @@ jobs:
155188
- dist/*
156189

157190
test-installation-deb:
158-
machine:
159-
image: aotuai/test-ubuntu-20.04:7d3e7d
191+
docker:
192+
- image: aotuai/test-ubuntu-20.04:7d3e7d
160193
steps:
161-
- run: sudo apt-get update
162194
- attach_workspace:
163195
at: /tmp/workspace
164-
- run: sudo apt-get install /tmp/workspace/dist/brainframe-cli-focal.deb
165-
- run: sudo brainframe install --noninteractive
166-
- run: sudo brainframe compose up -d
196+
- run:
197+
command: |
198+
apt-get -y install /tmp/workspace/dist/brainframe-cli-focal.deb
199+
export LOGNAME=root
200+
brainframe install --noninteractive
201+
brainframe compose up -d
167202
- assert-core-container-running
168203
- assert-core-responds-to-http
169-
- run: sudo brainframe uninstall --noninteractive
204+
- run: brainframe uninstall --noninteractive
170205
- assert-uninstalled-data-preserved:
171206
install_path: /usr/share/brainframe
172207
data_path: /var/lib/brainframe
173208

174209
upload-to-pypi:
175210
docker:
176-
- image: cimg/python:3.8
211+
- image: aotuai/brainframe-cli-env-20.04:7d3e7d
177212
environment:
178213
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__
179214
steps:
@@ -190,11 +225,25 @@ jobs:
190225
- run: sudo apt-get -y install python3-pip python3-dev curl git
191226
- checkout
192227
- install-poetry
228+
- run:
229+
command: |
230+
case "$CIRCLE_JOB" in
231+
*bionic*)
232+
echo 'export PY_TAG="<< pipeline.parameters.py36-tag >>"' >> $BASH_ENV
233+
;;
234+
*focal*)
235+
echo 'export PY_TAG="<< pipeline.parameters.py38-tag >>"' >> $BASH_ENV
236+
;;
237+
*)
238+
echo 'export PY_TAG="<< pipeline.parameters.py310-tag >>"' >> $BASH_ENV
239+
;;
240+
esac
241+
source $BASH_ENV
193242
- run:
194243
working_directory: ~/project/
195244
command: |
196-
cp deployment/pyproject.toml.py310.py312 pyproject.toml
197-
cp deployment/poetry.lock.py310.py312 poetry.lock
245+
cp deployment/pyproject.toml.${PY_TAG} pyproject.toml
246+
cp deployment/poetry.lock.${PY_TAG} poetry.lock
198247
sudo $(which poetry) install
199248
- run: sudo $(which poetry) run brainframe install --noninteractive
200249
- run: sudo $(which poetry) run brainframe compose up -d
@@ -235,12 +284,31 @@ jobs:
235284

236285
upload-binary:
237286
docker:
238-
- image: cimg/python:3.8
287+
- image: aotuai/brainframe-cli-env-20.04:7d3e7d
239288
steps:
240289
- attach_workspace:
241290
at: /tmp/workspace
242291
- checkout
243-
- run: poetry install
292+
- run:
293+
command: |
294+
export PYTHON_VERSION=$(python --version 2>&1 | cut -d" " -f2)
295+
case "${PYTHON_VERSION%.*}" in
296+
3.6)
297+
echo 'export PY_TAG="<< pipeline.parameters.py36-tag >>"' >> $BASH_ENV
298+
;;
299+
3.8)
300+
echo 'export PY_TAG="<< pipeline.parameters.py38-tag >>"' >> $BASH_ENV
301+
;;
302+
*)
303+
echo 'export PY_TAG="<< pipeline.parameters.py310-tag >>"' >> $BASH_ENV
304+
;;
305+
esac
306+
source $BASH_ENV
307+
- run:
308+
command: |
309+
cp deployment/pyproject.toml.${PY_TAG} pyproject.toml
310+
cp deployment/poetry.lock.${PY_TAG} poetry.lock
311+
poetry install
244312
- run: poetry run python package/upload_binary.py --binary-path /tmp/workspace/dist/brainframe
245313

246314
test-installation-binary:
@@ -263,10 +331,14 @@ jobs:
263331

264332
commands:
265333
install-poetry:
334+
parameters:
335+
poetry-version:
336+
type: string
337+
default: << pipeline.parameters.poetry-version >>
266338
steps:
267339
- run: >
268340
curl -sSL https://install.python-poetry.org
269-
| python3 - --version << pipeline.parameters.poetry-version >>
341+
| python3 - --version << parameters.poetry-version >>
270342
# Add to the PATH
271343
- run: echo 'export PATH=$HOME/.local/bin:$PATH' >> $BASH_ENV
272344
assert-core-container-running:

0 commit comments

Comments
 (0)