Skip to content

Commit e498a76

Browse files
Merge branch 'v24.05.x-restored' of https://github.com/simplyblock-io/spdk into v24.05.x-restored
2 parents dbc0586 + 1b27908 commit e498a76

File tree

2 files changed

+82
-0
lines changed

2 files changed

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

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

0 commit comments

Comments
 (0)