Skip to content

Commit dd50f11

Browse files
push image builder files
1 parent 40a5c21 commit dd50f11

4 files changed

+172
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: build_image_spdk_core_amd
2+
3+
on:
4+
workflow_run:
5+
workflows: ["build_image_spdk_core_arm"]
6+
types:
7+
- completed
8+
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout the triggered branch
15+
uses: actions/checkout@v3
16+
with:
17+
ref: ${{ github.event.workflow_run.head_branch }}
18+
19+
- name: Set branch name from triggered workflow
20+
run: echo "BRANCH_NAME=${{ github.event.workflow_run.head_branch }}" >> $GITHUB_ENV
21+
22+
23+
- name: Build the docker image
24+
run: docker build --file docker/Dockerfile_spdk --tag simplyblock/spdk-core:$BRANCH_NAME-amd64 .
25+
26+
- name: Login to Docker Hub
27+
uses: docker/login-action@v1
28+
with:
29+
username: hamdysimplyblock
30+
password: ${{ secrets.DOCKER_PASS }}
31+
32+
- name: Push Images
33+
run: docker push simplyblock/spdk-core:$BRANCH_NAME-amd64
34+
35+
- name: Configure AWS Credentials
36+
uses: aws-actions/configure-aws-credentials@v1
37+
with:
38+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_HAMDI }}
39+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_HAMDI }}
40+
aws-region: us-east-1
41+
42+
- name: Login to ECR
43+
id: login-ecr
44+
uses: aws-actions/amazon-ecr-login@v2
45+
46+
- name: Tag docker image
47+
run: docker tag simplyblock/spdk-core:$BRANCH_NAME-amd64 565979732541.dkr.ecr.us-east-1.amazonaws.com/spdk-core:$BRANCH_NAME-amd64
48+
49+
- name: Push the docker image
50+
run: docker image push 565979732541.dkr.ecr.us-east-1.amazonaws.com/spdk-core:$BRANCH_NAME-amd64
51+
- name: Create the manifest
52+
run: |
53+
docker manifest create simplyblock/spdk-core:$BRANCH_NAME-latest simplyblock/spdk-core:$BRANCH_NAME-arm64 simplyblock/spdk-core:$BRANCH_NAME-amd64
54+
docker manifest create 565979732541.dkr.ecr.us-east-1.amazonaws.com/spdk-core:$BRANCH_NAME-latest 565979732541.dkr.ecr.us-east-1.amazonaws.com/spdk-core:$BRANCH_NAME-arm64 565979732541.dkr.ecr.us-east-1.amazonaws.com/spdk-core:$BRANCH_NAME-amd64
55+
docker manifest annotate simplyblock/spdk-core:$BRANCH_NAME-latest simplyblock/spdk-core:$BRANCH_NAME-arm64 --arch arm64
56+
docker manifest annotate simplyblock/spdk-core:$BRANCH_NAME-latest simplyblock/spdk-core:$BRANCH_NAME-amd64 --arch amd64
57+
docker manifest annotate 565979732541.dkr.ecr.us-east-1.amazonaws.com/spdk-core:$BRANCH_NAME-latest 565979732541.dkr.ecr.us-east-1.amazonaws.com/spdk-core:$BRANCH_NAME-arm64 --arch arm64
58+
docker manifest annotate 565979732541.dkr.ecr.us-east-1.amazonaws.com/spdk-core:$BRANCH_NAME-latest 565979732541.dkr.ecr.us-east-1.amazonaws.com/spdk-core:$BRANCH_NAME-amd64 --arch amd64
59+
docker manifest push simplyblock/spdk-core:$BRANCH_NAME-latest
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: build_image_spdk_core_arm
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
jobs:
8+
build:
9+
runs-on: linux-arm
10+
steps:
11+
- name: Checkout the triggered branch
12+
uses: actions/checkout@v3
13+
with:
14+
ref: ${{ github.event.workflow_run.head_branch }}
15+
16+
- name: Set docker image tag
17+
id: get_info
18+
run: |
19+
if [[ "${{github.ref}}" == refs/pull/* ]]; then
20+
tag=${GITHUB_REF/\/merge/}
21+
echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV
22+
else
23+
echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV
24+
fi
25+
echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV
26+
echo "SHA=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}')" >> $GITHUB_ENV
27+
28+
- name: Build the docker image
29+
run: docker build --file docker/Dockerfile_spdk_arm --tag simplyblock/spdk-core:$TAG-arm64 .
30+
31+
- name: Login to Docker Hub
32+
uses: docker/login-action@v1
33+
with:
34+
username: hamdysimplyblock
35+
password: ${{ secrets.DOCKER_PASS }}
36+
37+
- name: Push Images
38+
run: docker push simplyblock/spdk-core:$TAG-arm64
39+
40+
- name: Configure AWS Credentials
41+
uses: aws-actions/configure-aws-credentials@v1
42+
with:
43+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_HAMDI }}
44+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_HAMDI }}
45+
aws-region: us-east-1
46+
47+
- name: Login to ECR
48+
id: login-ecr
49+
uses: aws-actions/amazon-ecr-login@v2
50+
51+
- name: Tag docker image
52+
run: docker tag simplyblock/spdk-core:$TAG-arm64 565979732541.dkr.ecr.us-east-1.amazonaws.com/spdk-core:$TAG-arm64
53+
54+
- name: Push the docker image
55+
run: docker image push 565979732541.dkr.ecr.us-east-1.amazonaws.com/spdk-core:$TAG-arm64

docker/Dockerfile_spdk

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM fedora:37
2+
3+
# push to "simplyblock/spdk-core:$TAG"
4+
5+
USER root
6+
7+
WORKDIR /root
8+
9+
COPY ./ /root/spdk/
10+
11+
RUN dnf install -y git diffutils procps-ng pip kmod hostname wget pkg-config cmake nano systemd-udev
12+
13+
RUN cd spdk && git submodule update --init --depth 1
14+
15+
RUN cd spdk && scripts/pkgdep.sh --rdma --pmem
16+
17+
RUN mkdir /tmp/pmem
18+
19+
RUN pip3 install grpcio-tools==1.51.3 protobuf==4.22.1
20+
21+
RUN sed -i "s/^#define SPDK_JSONRPC_RECV_BUF_SIZE.*/#define SPDK_JSONRPC_RECV_BUF_SIZE\t(32 * 1024 * 1024)/" /root/spdk/lib/jsonrpc/jsonrpc_internal.h
22+
23+
RUN sed -i "s/^#define SPDK_BDEV_QOS_MIN_IOS_PER_SEC.*/#define SPDK_BDEV_QOS_MIN_IOS_PER_SEC\t200/" /root/spdk/lib/bdev/bdev.c
24+
25+
RUN sed -i "s/^#define SPDK_BDEV_QOS_TIMESLICE_IN_USEC.*/#define SPDK_BDEV_QOS_TIMESLICE_IN_USEC\t5000/" /root/spdk/lib/bdev/bdev.c
26+
27+
RUN cd spdk && ./configure --with-crypto --with-rdma --disable-tests --disable-unit-tests --disable-examples --with-ocf --with-fuse --with-nvme-cuse --target-arch=nehalem
28+
29+
RUN cd spdk && make --no-builtin-rules -j16

docker/Dockerfile_spdk_arm

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM fedora:37
2+
3+
# push to "simplyblock/spdk-core:$TAG"
4+
5+
USER root
6+
7+
WORKDIR /root
8+
9+
COPY ./ /root/spdk/
10+
11+
RUN dnf install -y git diffutils procps-ng pip kmod hostname wget pkg-config cmake nano systemd-udev
12+
13+
RUN cd spdk && git submodule update --init --depth 1
14+
15+
RUN cd spdk && scripts/pkgdep.sh --rdma --pmem
16+
17+
RUN mkdir /tmp/pmem
18+
19+
RUN pip3 install grpcio-tools==1.51.3 protobuf==4.22.1
20+
21+
RUN sed -i "s/^#define SPDK_JSONRPC_RECV_BUF_SIZE.*/#define SPDK_JSONRPC_RECV_BUF_SIZE\t(32 * 1024 * 1024)/" /root/spdk/lib/jsonrpc/jsonrpc_internal.h
22+
23+
RUN sed -i "s/^#define SPDK_BDEV_QOS_MIN_IOS_PER_SEC.*/#define SPDK_BDEV_QOS_MIN_IOS_PER_SEC\t200/" /root/spdk/lib/bdev/bdev.c
24+
25+
RUN sed -i "s/^#define SPDK_BDEV_QOS_TIMESLICE_IN_USEC.*/#define SPDK_BDEV_QOS_TIMESLICE_IN_USEC\t5000/" /root/spdk/lib/bdev/bdev.c
26+
27+
RUN cd spdk && ./configure --with-crypto --with-rdma --disable-tests --disable-unit-tests --disable-examples --with-ocf --with-fuse --with-nvme-cuse
28+
29+
RUN cd spdk && make --no-builtin-rules -j16

0 commit comments

Comments
 (0)