Skip to content

Commit

Permalink
feat: Fix CI build for new build system
Browse files Browse the repository at this point in the history
- Set up QEMU on CI to allow execution of RISC-V containers
- Update CI configuration to use Ubuntu 22.04 instead of 20.04
- Update all Python DApps to use Python 3.10 instead of 3.11 (there are
incompatibilities of some Python libraries with Python 3.11,
particularly eth_abi 3.x)
  • Loading branch information
miltonjonat committed Mar 9, 2023
1 parent 34a2d6f commit 35cfb52
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 13 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/dapp-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ on:

jobs:
build_package:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
outputs:
dapp-image: ${{ steps.set-dapp-image.outputs.dapp-image }}
steps:
- uses: actions/checkout@v3

# Add support for more platforms with QEMU (necessary to run RISC-V containers)
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/echo-python-dapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
DAPP_IMAGE: ${{ needs.build.outputs.dapp-image }}
run: |
yarn install
yarn test:ci echo-python --verbose
yarn test:ci echo-python --verbose --pollingTimeout 150
working-directory: ./integration-tests/

- name: Save docker logs
Expand Down
2 changes: 1 addition & 1 deletion auction/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker.io/docker/dockerfile:1.4
FROM --platform=riscv64 cartesi/python:jammy
FROM --platform=riscv64 cartesi/python:3.10-jammy

WORKDIR /opt/cartesi/dapp
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion calculator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker.io/docker/dockerfile:1.4
FROM --platform=riscv64 cartesi/python:jammy
FROM --platform=riscv64 cartesi/python:3.10-jammy

WORKDIR /opt/cartesi/dapp
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion converter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker.io/docker/dockerfile:1.4
FROM --platform=riscv64 cartesi/python:jammy
FROM --platform=riscv64 cartesi/python:3.10-jammy

WORKDIR /opt/cartesi/dapp
COPY . .
Expand Down
4 changes: 2 additions & 2 deletions echo-python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker.io/docker/dockerfile:1.4
FROM --platform=riscv64 cartesi/python:jammy as dapp
FROM --platform=riscv64 cartesi/python:3.10-jammy as dapp

WORKDIR /opt/cartesi/dapp
COPY . .
RUN pip install -r requirements.txt
RUN pip install -r requirements.txt
2 changes: 1 addition & 1 deletion erc20/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker.io/docker/dockerfile:1.4
FROM --platform=riscv64 cartesi/python:jammy
FROM --platform=riscv64 cartesi/python:3.10-jammy

WORKDIR /opt/cartesi/dapp
COPY . .
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ The tests are written in Typescript and are based on frameworks [Mocha](https://
To run tests on a DApp in `prod` mode, type the following command:

```shell
yarn start test:prod DAPP_NAME
yarn test:prod DAPP_NAME
```

Or, to run tests on a DApp in `host` mode, type the following command:

```shell
yarn start test:host DAPP_NAME
yarn test:host DAPP_NAME
```

Where `DAPP_NAME` is the name of the sub-directory where the tests for the specific DApp live.
2 changes: 1 addition & 1 deletion knn/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker.io/docker/dockerfile:1.4
FROM --platform=riscv64 cartesi/python:jammy
FROM --platform=riscv64 cartesi/python:3.10-jammy

WORKDIR /opt/cartesi/dapp
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion m2cgen/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY ./model .
RUN pip3 install -r requirements.txt
RUN python3 build_model.py

FROM --platform=riscv64 cartesi/python:jammy as dapp
FROM --platform=riscv64 cartesi/python:3.10-jammy as dapp

WORKDIR /opt/cartesi/dapp
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion sqlite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker.io/docker/dockerfile:1.4
FROM --platform=riscv64 cartesi/python:jammy
FROM --platform=riscv64 cartesi/python:3.10-jammy

WORKDIR /opt/cartesi/dapp
COPY . .
Expand Down

0 comments on commit 35cfb52

Please sign in to comment.