Skip to content

Commit 316bc68

Browse files
authored
replace conda/nuitka/fbs/poetry [CPP-310][CPP-322][CPP-321] (#146)
* replaces conda/nuitka with standalone python builds * replaces installers with standalone python distribution * replaces poetry with flit for building frontend wheel * minor Makefile improvements
1 parent 01f6e86 commit 316bc68

Some content is hidden

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

70 files changed

+601
-1438
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
src/main/fbs/* linguist-vendored
2-
src/main/nuitka/* linguist-vendored
31
"console_backend/tests/data/*" filter=lfs diff=lfs merge=lfs -text

.github/ci-build.sh

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 72 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ env:
1313
RUST_CACHE_DIRS: "~/.cargo/registry\n~/.cargo/git\ntarget\n"
1414
LIBCLANG_PATH_WIN: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/Llvm/x64/bin"
1515
CARGO_MAKE_VERSION: 0.35.0
16-
MINICONDA_VERSION: "py38_4.10.3"
1716
CARGO_INCREMENTAL: 0
1817
RUSTFLAGS: "-C debuginfo=0"
1918

@@ -76,29 +75,23 @@ jobs:
7675
toolchain: stable
7776

7877
- uses: Swatinem/rust-cache@v1
79-
78+
8079
- uses: davidB/rust-cargo-make@v1
8180
with:
8281
version: ${{ env.CARGO_MAKE_VERSION }}
8382

84-
- uses: conda-incubator/setup-miniconda@v2
85-
with:
86-
activate-environment: console_pp
87-
environment-file: conda.yml
88-
miniconda-version: ${{ env.MINICONDA_VERSION }}
89-
9083
- name: Cache pip
9184
uses: actions/cache@v2
9285
with:
9386
path: ${{ env.PIP_CACHE_DIR }}
94-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
87+
key: ${{ runner.os }}-pyproject-toml-${{ hashFiles('pyproject.toml') }}
9588
restore-keys: |
96-
${{ runner.os }}-pip-
89+
${{ runner.os }}-pyproject-toml-
9790
${{ runner.os }}-
9891
99-
- name: Run Pip Install
92+
- name: Set up python builder
10093
run: |
101-
cargo make pip-install-dev
94+
cargo make setup-builder
10295
10396
- name: Run Backend Benchmarks (Windows)
10497
env:
@@ -153,26 +146,19 @@ jobs:
153146
run: |
154147
sudo apt-get update && sudo apt-get install -y capnproto libudev-dev
155148
156-
- uses: conda-incubator/setup-miniconda@v2
157-
with:
158-
activate-environment: console_pp
159-
environment-file: conda.yml
160-
miniconda-version: ${{ env.MINICONDA_VERSION }}
161-
162-
- name: Run Requirements Generation Check
163-
run: |
164-
cargo make poetry-export
165-
git diff --exit-code
166-
167149
- name: Cache pip
168150
uses: actions/cache@v2
169151
with:
170152
path: ${{ env.PIP_CACHE_DIR }}
171-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
153+
key: ${{ runner.os }}-pyproject-toml-${{ hashFiles('pyproject.toml') }}
172154
restore-keys: |
173-
${{ runner.os }}-pip-
155+
${{ runner.os }}-pyproject-toml-
174156
${{ runner.os }}-
175157
158+
- name: Set up python builder
159+
run: |
160+
cargo make setup-builder
161+
176162
- name: Run Checks
177163
run: |
178164
cargo make check-all
@@ -266,56 +252,53 @@ jobs:
266252
with:
267253
version: ${{ env.CARGO_MAKE_VERSION }}
268254

269-
- uses: conda-incubator/setup-miniconda@v2
270-
with:
271-
activate-environment: console_pp
272-
environment-file: conda.yml
273-
miniconda-version: ${{ env.MINICONDA_VERSION }}
274-
275255
- name: Cache pip
276256
uses: actions/cache@v2
277257
with:
278258
path: ${{ env.PIP_CACHE_DIR }}
279-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
259+
key: ${{ runner.os }}-pyproject-toml-${{ hashFiles('pyproject.toml') }}
280260
restore-keys: |
281-
${{ runner.os }}-pip-
261+
${{ runner.os }}-pyproject-toml-
282262
${{ runner.os }}-
283263
284-
- name: Run Pip Install
264+
- name: Set up python builder
285265
run: |
286-
cargo make pip-install-dev
266+
cargo make setup-builder
287267
288268
- name: Build ${{ runner.os }} Binaries.
289269
env:
290270
LIBCLANG_PATH: ${{ env.LIBCLANG_PATH_WIN }}
291271
run: |
292-
cargo make prod-installer
272+
cargo make create-dist
293273
if: matrix.os == 'windows-2019'
294274

295275
- name: Build ${{ runner.os }} Binaries.
296276
shell: bash
297277
run: |
298-
cargo make prod-installer
278+
cargo make create-dist
299279
if: matrix.os != 'windows-2019'
300280

301281
- name: Pull Git LFS objects
302282
run: git lfs pull
303283
env:
304284
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=no
305-
- name: Zip ${{ runner.os }} Binaries.
285+
- name: Archive ${{ runner.os }} Binaries.
306286
env:
307287
OS_NAME: ${{ runner.os }}
308288
shell: bash
309289
run: |
310-
bash ./.github/ci-build.sh
290+
mkdir bench
291+
cp -r console_backend/tests/data bench
292+
cp utils/bench_runner.py bench
293+
cd bench
294+
7z a -tzip "../$OS_NAME.zip" *;
295+
cd ..
296+
echo "${OS_NAME}.zip" >bench-archive.filename;
297+
echo "BENCH_ARCHIVE=$(cat bench-archive.filename)" >>$GITHUB_ENV
298+
299+
RELEASE_ARCHIVE=$(find . -maxdepth 1 -iname "*.tar.xz")
300+
echo $RELEASE_ARCHIVE >release-archive.filename
311301
echo "RELEASE_ARCHIVE=$(cat release-archive.filename)" >>$GITHUB_ENV
312-
echo "BENCH_ARCHIVE=$(cat bench.filename)" >>$GITHUB_ENV
313-
- name: ${{ runner.os }} Installer Size Benchmark.
314-
env:
315-
OS_NAME: ${{ runner.os }}
316-
shell: bash
317-
run: |
318-
cargo make disk-usage-bench
319302
- uses: actions/upload-artifact@v2
320303
with:
321304
name: ${{ runner.os }}-artifacts
@@ -327,7 +310,13 @@ jobs:
327310
name: ${{ runner.os }}-artifacts-bench
328311
path: |
329312
${{ env.BENCH_ARCHIVE }}
330-
bench.filename
313+
bench-archive.filename
314+
- name: ${{ runner.os }} Installer Size Benchmark.
315+
env:
316+
OS_NAME: ${{ runner.os }}
317+
shell: bash
318+
run: |
319+
cargo make disk-usage-bench
331320
frontend_bench:
332321
name: Run Frontend Benchmarks
333322
timeout-minutes: 30
@@ -344,38 +333,62 @@ jobs:
344333
- name: Remove previous build.
345334
shell: bash
346335
run: |
347-
rm -rf output
336+
rm -rf console
337+
rm -rf bench
338+
339+
- uses: actions/download-artifact@v2
340+
with:
341+
name: ${{ matrix.os }}-artifacts
342+
path: |
343+
console
344+
348345
- uses: actions/download-artifact@v2
349346
with:
350347
name: ${{ matrix.os }}-artifacts-bench
351348
path: |
352-
output
349+
bench
350+
353351
- name: Extract binary and data.
352+
shell: bash
354353
run: |
355-
cd output
356-
7z x $(cat bench.filename) -aoa -o${{ matrix.os }}
354+
cd console
355+
archive=$(cat release-archive.filename)
356+
7z x $archive -aoa
357+
7z x ${archive%.xz} -aoa
358+
echo "extracted release-archive"
359+
mv ../bench/${{ matrix.os }}.zip .
360+
7z x ${{ matrix.os }}.zip -aoa
361+
echo "extracted bench data"
357362
358363
- name: Run CPU Frontend Benchmark.
359364
shell: bash
360365
run: |
361-
cd output/${{ matrix.os }}
366+
cd console
362367
if [ "$RUNNER_OS" == "Windows" ]; then
363-
python bench_runner.py --frontend_cpu --executable=swift_navigation_console.exe
368+
python ./bench_runner.py --frontend_cpu --executable="${GITHUB_WORKSPACE}/console/Scripts/swiftnav-console.exe"
364369
elif [ "$RUNNER_OS" == "macOS" ]; then
365-
python bench_runner.py --frontend_cpu --executable=./main
370+
chmod +x "${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
371+
chmod +x "${GITHUB_WORKSPACE}/console/bin/python3"
372+
python ./bench_runner.py --frontend_cpu --executable="${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
366373
elif [ "$RUNNER_OS" == "Linux" ]; then
367-
python bench_runner.py --frontend_cpu --executable=./swift_navigation_console
374+
chmod +x "${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
375+
chmod +x "${GITHUB_WORKSPACE}/console/bin/python3"
376+
python ./bench_runner.py --frontend_cpu --executable="${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
368377
fi
369378
- name: Run MEM Frontend Benchmark.
370379
shell: bash
371380
run: |
372-
cd output/${{ matrix.os }}
381+
cd console
373382
if [ "$RUNNER_OS" == "Windows" ]; then
374-
python bench_runner.py --frontend_mem --executable=swift_navigation_console.exe
383+
python ./bench_runner.py --frontend_mem --executable="${GITHUB_WORKSPACE}/console/Scripts/swiftnav-console.exe"
375384
elif [ "$RUNNER_OS" == "macOS" ]; then
376-
python bench_runner.py --frontend_mem --executable=./main
385+
chmod +x "${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
386+
chmod +x "${GITHUB_WORKSPACE}/console/bin/python3"
387+
python ./bench_runner.py --frontend_mem --executable="${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
377388
elif [ "$RUNNER_OS" == "Linux" ]; then
378-
python bench_runner.py --frontend_mem --executable=./swift_navigation_console
389+
chmod +x "${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
390+
chmod +x "${GITHUB_WORKSPACE}/console/bin/python3"
391+
python ./bench_runner.py --frontend_mem --executable="${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
379392
fi
380393
381394

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ target
66
*.dist
77
main.app/
88
*.dmg
9+
*.tar.xz
10+
*.tar
911
.DS_Store
10-
src/main/python/console_resources.py
12+
swiftnav_console/console_resources.py
13+
*.*~
14+
py39-dist/
15+
py39/
16+
dist/
1117
console_backend/tests/fileout.json
18+
get-pip.py

.python/.gitignore

Whitespace-only changes.

Cargo.lock

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["console_backend"]
2+
members = ["console_backend", "entrypoint"]
33

44
[profile.release]
55
lto = true

0 commit comments

Comments
 (0)