Skip to content

Commit

Permalink
Use docker in GA [AP-1085] (#1393)
Browse files Browse the repository at this point in the history
# Description

@swift-nav/devinfra

Make use of `libsbp-build` docker image in the "check generated
artefacts" stage. This bring consistency to the artefacts generated in
the CI check since the canonical way of generating libsbp is via the
docker image. This PR doesn't actually make any changes but should
resolve some of the issues which have been seen recently when generating
libsbp locally versus in CI.

# API compatibility

Does this change introduce a API compatibility risk?

N/A

## API compatibility plan

If the above is "Yes", please detail the compatibility (or migration)
plan:

N/A

# JIRA Reference

https://swift-nav.atlassian.net/browse/AP-1085
  • Loading branch information
woodfell authored Dec 18, 2023
1 parent 1bfe255 commit e473ea4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 32 deletions.
33 changes: 7 additions & 26 deletions .github/workflows/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,20 @@ jobs:
generation:
name: Generated artifacts
runs-on: ubuntu-20.04
container:
image: swiftnav/libsbp-build:2023-12-18
options: --user root
volumes:
- ${{ github.workspace }}:/mnt/workspace
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive

- name: Installing dependencies
- name: Set safe git directory
run: |
sudo apt-get -qq update
sudo apt-get install -y tox python3-sphinx clang-format-6.0 enchant
pip3 install tox-run-command
tox -e py --notest
- name: Installing Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Installing Quicktype
run: |
npm ci
npm install -g quicktype
- uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.1.1
git config --global --add safe.directory /__w/libsbp/libsbp
- name: Generate tests
run: |
Expand All @@ -58,16 +46,9 @@ jobs:
git diff --cached --exit-code
git diff --exit-code
# - name: Generate html for python
# run: make html-python # emits python/docs/build/html, not checked in

- name: Generate javadocs for java
run: make javadocs # emits java/build/docs/javadoc, not used

- name: Installing pdf dependencies
run: |
sudo apt-get install -y texlive-latex-extra texlive-fonts-extra texlive-science graphviz
- name: Generate pdf
id: pdf
run: |
Expand Down
6 changes: 3 additions & 3 deletions HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ Some thoughts to consider when adding a new message:
It's highly recommended to use the docker container to run the release process,
the docker container can be pulled from DockerHub and launched via this command:

docker run -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:2022-06-14
docker run -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:2023-12-19

You can invoke individual stages like so:

docker run -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:2022-06-14 \
docker run -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:2023-12-19 \
/bin/bash -c "make python"

Check this [link](https://hub.docker.com/r/swiftnav/libsbp-build/tags) for newer tags.
Expand Down Expand Up @@ -453,7 +453,7 @@ For more info see: <https://docs.gradle.org/current/userguide/signing_plugin.htm
Now, invoke docker like this in order to run the `dist-java` task:

```shell
docker run -v $HOME/Documents:/keys -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:2022-06-14
docker run -v $HOME/Documents:/keys -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:2023-12-19
```

To publish, you'll run `make dist-java` (which will run `gradle sign` and
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Start [Docker desktop](https://docs.docker.com/docker-for-mac/).
The quickest method to get going is to just pull a prebuilt copy from DockerHub
(no guarantees on freshness) by running the following on your command line:

docker run --rm -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:2022-06-14 /bin/bash
docker run --rm -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:2023-12-19 /bin/bash

This will mount your local copy of the libsbp repository onto the image.

Expand Down Expand Up @@ -156,12 +156,12 @@ This could take several hours to run. Alternately, the docker image will run
the `make all` command by default, so you can kick off the `make all` process
by simply running the following command:

docker run --rm -v $PWD:/mnt/workspace -i -t libsbp-build:2022-06-14
docker run --rm -v $PWD:/mnt/workspace -i -t libsbp-build:2023-12-19

To speed up this process you can attempt to run Python environment tests in
paralell with:

docker run --rm -v $PWD:/mnt/workspace -i -t -e SBP_TOX_PARALLEL=auto libsbp-build:2022-06-14
docker run --rm -v $PWD:/mnt/workspace -i -t -e SBP_TOX_PARALLEL=auto libsbp-build:2023-12-19

When you are finished, quit Docker so that it would not unnecessarily use up
resources on your machine.
Expand Down

0 comments on commit e473ea4

Please sign in to comment.