Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Github workflows to utilize building on docker engine #61

Closed
DieHard073055 opened this issue Sep 1, 2022 · 10 comments · Fixed by #163
Closed

Github workflows to utilize building on docker engine #61

DieHard073055 opened this issue Sep 1, 2022 · 10 comments · Fixed by #163
Assignees
Labels
area/packages area/workflow kind/feature New feature request priority/urgent-now Urgent fix, as fast as possible triage/accepted Triage has been accepted

Comments

@DieHard073055
Copy link
Contributor

What would you like to be added:

Builds should use docker qemu + buildx.
Building on docker engine will allow us to utilize qemu.

Why is this needed:

To make the builds as OS agnostic as possible.

Reference Conversation

@DieHard073055 DieHard073055 added the kind/feature New feature request label Sep 1, 2022
@defichain-bot defichain-bot added the needs/triage Waiting for triage to be accepted label Sep 1, 2022
@defichain-bot
Copy link
Member

@DieHard073055: Thanks for opening an issue, it is currently awaiting triage.

The triage/accepted label can be added by foundation members by writing /triage accepted in a comment.

Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@defichain-bot defichain-bot added the needs/area Needs area label(s) label Sep 1, 2022
@defichain-bot
Copy link
Member

@DieHard073055: There are no 'area' labels on this issue. Adding an appropriate label will greatly expedite the process for us. You can add as many area as you see fit. If you are unsure what to do you can ignore this!

You can add area labels by leaving a /area comment.

Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@fuxingloh
Copy link
Contributor

/area workflows
/triage accepted

@defichain-bot defichain-bot added triage/accepted Triage has been accepted and removed needs/triage Waiting for triage to be accepted labels Sep 1, 2022
@fuxingloh
Copy link
Contributor

/area workflow

@fuxingloh
Copy link
Contributor

/area packages
/package testcontainers
/priority important-soon

@fuxingloh
Copy link
Contributor

/assign @mambisi can you help with this

@mambisi
Copy link

mambisi commented Oct 28, 2022

@fuxingloh
Copy link
Contributor

fuxingloh commented Oct 31, 2022

@fuxingloh cd.yml on this https://github.com/DeFiCh/metachain/blob/c0820458c0bad868dd36a495045ca24460cc5873/.github/workflows/cd.yml already build with qemu buildx

The setup and build are done on the GitHub workflow host instance via:

runs-on: ubuntu-latest

with this build and run step:

- name: Set up rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # tag=v1.0.7
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown
default: true
override: true
- name: Cargo build
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # tag=v1.0.3
with:
command: build
args: --release --all

the binary is then copied into a Docker Image via:

- name: Save binary
run: |
mkdir -p build
cp target/release/meta-node build/

and

metachain/Dockerfile

Lines 5 to 6 in cb6307d

# Requires copy the binary to `build` folder beforehand
COPY build/* /metachain


This issue was created to move the build process into Docker Engine with qemu and buildx. Since we're now building on host machine instead of a Docker multi-arch engine: https://www.docker.com/blog/multi-arch-images/

@mambisi
Copy link

mambisi commented Oct 31, 2022

okay got it

@fuxingloh
Copy link
Contributor

okay got it

I'm not too familiar with Cargo build. Since for other languages, you need to build on the same OS/target to run on the same target arch/env. Or generally that's how it's done afaik

I will defer to you to make this decision, it might not warrant or require it. If you think otherwise just drop a note here with the explanation, I will close this issue.

@fuxingloh fuxingloh added priority/urgent-now Urgent fix, as fast as possible and removed priority/important-soon Will be important soon labels Nov 16, 2022
fuxingloh added a commit that referenced this issue Nov 23, 2022
… archive setup (#161)

#### What this PR does / why we need it:

As per title, to assist with #61 build durations. For better DX.
fuxingloh added a commit that referenced this issue Nov 23, 2022
<!--  Thanks for sending a pull request! -->

#### What this PR does / why we need it:

> Experimental

As per the title. This PR adds multi-stage Docker build for
`./meta-node`. All docker images now utilize Docker to build.

Fixes #61

Signed-off-by: Fuxing Loh <[email protected]>
Co-authored-by: Diehard073055 <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/packages area/workflow kind/feature New feature request priority/urgent-now Urgent fix, as fast as possible triage/accepted Triage has been accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants