Skip to content

Commit

Permalink
create base image for building mm2 and use it for CI (#1741)
Browse files Browse the repository at this point in the history
* create base image for building mm2 and use it for CI

Signed-off-by: ozkanonur <work@onurozkan.dev>

* add changelog entry

Signed-off-by: ozkanonur <work@onurozkan.dev>
  • Loading branch information
onur-ozkan authored Mar 30, 2023
1 parent 32e7c65 commit 51435b3
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 11 deletions.
55 changes: 55 additions & 0 deletions .docker/Dockerfile.ci-container
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM docker.io/debian:buster-slim

MAINTAINER Onur Özkan <onur@komodoplatform.com>

RUN apt-get update -y

RUN apt-get install -y \
build-essential \
cmake \
gcc-multilib \
ca-certificates \
curl \
wget \
gnupg \
git \
zip \
sudo

RUN ln -s /usr/bin/python3 /bin/python

RUN apt install -y \
software-properties-common \
lsb-release \
gnupg

RUN wget https://apt.llvm.org/llvm.sh

RUN chmod +x llvm.sh

RUN ./llvm.sh 16

RUN rm ./llvm.sh

RUN ln -s /usr/bin/clang-16 /usr/bin/clang

ENV AR=/usr/bin/llvm-ar-16
ENV CC=/usr/bin/clang-16

RUN mkdir -m 0755 -p /etc/apt/keyrings

RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg

RUN echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

RUN apt-get update -y

RUN apt-get install -y \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
56 changes: 50 additions & 6 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,18 @@ env:
jobs:
linux-x86-64:
timeout-minutes: 30
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
- uses: actions/checkout@v3

- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Install toolchain
run: |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
Expand Down Expand Up @@ -219,17 +228,26 @@ jobs:

wasm:
timeout-minutes: 30
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
- uses: actions/checkout@v3

- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Install toolchain
run: |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
rustup default nightly-2022-10-29
rustup target add wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | bash -s -- -y

- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -319,9 +337,18 @@ jobs:

android-aarch64:
timeout-minutes: 30
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
- uses: actions/checkout@v3

- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Install toolchain
run: |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
Expand Down Expand Up @@ -373,9 +400,18 @@ jobs:

android-armv7:
timeout-minutes: 30
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
- uses: actions/checkout@v3

- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Install toolchain
run: |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
Expand Down Expand Up @@ -430,10 +466,18 @@ jobs:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/dev'
needs: linux-x86-64
timeout-minutes: 15
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
- uses: actions/checkout@v2

- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
Expand Down
46 changes: 41 additions & 5 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,18 @@ env:
jobs:
linux-x86-64:
timeout-minutes: 60
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
- uses: actions/checkout@v3

- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Install toolchain
run: |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
Expand Down Expand Up @@ -193,17 +202,26 @@ jobs:

wasm:
timeout-minutes: 60
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
- uses: actions/checkout@v3

- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Install toolchain
run: |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
rustup default nightly-2022-10-29
rustup target add wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | bash -s -- -y

- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -281,9 +299,18 @@ jobs:

android-aarch64:
timeout-minutes: 60
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
- uses: actions/checkout@v3

- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Install toolchain
run: |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
Expand Down Expand Up @@ -329,9 +356,18 @@ jobs:

android-armv7:
timeout-minutes: 60
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
- uses: actions/checkout@v3

- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Install toolchain
run: |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
**Enhancements/Fixes:**
- CI/CD workflow logics are improved [#1736](https://github.com/KomodoPlatform/atomicDEX-API/pull/1736)
- Project root is simplified/refactored [#1738](https://github.com/KomodoPlatform/atomicDEX-API/pull/1738)
- Created base image to provide more glibc compatible pre-built binaries for linux [#1741](https://github.com/KomodoPlatform/atomicDEX-API/pull/1741)

## v1.0.1-beta - 2023-03-17

Expand Down
3 changes: 3 additions & 0 deletions scripts/ci/android-ndk.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

set -ex

NDK_URL=https://dl.google.com/android/repository/android-ndk-r21b-linux-x86_64.zip
Expand All @@ -9,6 +11,7 @@ main() {
local dependencies=(
unzip
python3
python3-distutils
curl
)

Expand Down

0 comments on commit 51435b3

Please sign in to comment.