Skip to content

Commit 244a191

Browse files
committed
ci: add sconification workflow
1 parent 9635f8c commit 244a191

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed

.github/workflows/sconify.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: sconify
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
env:
9+
IMG_FROM: docker-regis.iex.ec/tee-worker-post-compute:rust
10+
IMG_TO: docker-regis.iex.ec/tee-worker-post-compute-unlocked:rust-sconify-5.9.0-debug
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
- name: Build the docker image
15+
run: docker build -t $IMG_FROM .
16+
- name: Login to Scontain registry
17+
uses: docker/login-action@v3
18+
with:
19+
registry: registry.scontain.com
20+
username: ${{ secrets.SCONTAIN_USERNAME }}
21+
password: ${{ secrets.SCONTAIN_PASSWORD }}
22+
- name: Sconify
23+
run: scone/sconify.sh
24+
- name: Login to Docker regis
25+
uses: docker/login-action@v3
26+
with:
27+
registry: docker-regis.iex.ec
28+
username: ${{ secrets.NEXUS_USERNAME }}
29+
password: ${{ secrets.NEXUS_PASSWORD }}
30+
- name: Publish
31+
run: docker push $IMG_TO
32+
- name: Clean
33+
run: docker image rm -f $IMG_FROM $IMG_TO registry.scontain.com/scone-debug/iexec-sconify-image-unlocked:5.9.0

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM rust:1.86-alpine3.21 AS builder
2+
3+
RUN apk add --no-cache musl-dev openssl-dev
4+
5+
WORKDIR /app
6+
7+
COPY . /app
8+
9+
RUN cargo build --release
10+
11+
FROM alpine:3.21
12+
13+
WORKDIR /app
14+
15+
RUN apk add --no-cache libgcc
16+
17+
COPY --from=builder /app/target/release/tee-worker-post-compute .
18+
19+
CMD ["/app/tee-worker-post-compute"]

scone/sconify.args

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--verbose
2+
--name=tee-worker-post-compute
3+
--base=alpine:3.21
4+
--from=${IMG_FROM}
5+
--to=${IMG_TO}
6+
--binary=/app/tee-worker-post-compute
7+
--heap=1G
8+
--stack=8M
9+
--host-path=/etc/hosts
10+
--host-path=/etc/resolv.conf

scone/sconify.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
cd $(dirname $0)
4+
5+
SCONE_IMG_NAME=scone-debug/iexec-sconify-image-unlocked
6+
SCONE_IMG_VERSION=5.9.0
7+
8+
if [ -z "$IMG_FROM" ] || [ -z "$IMG_TO" ] ; then
9+
echo "IMG_FROM and IMG_TO variables need to be defined"
10+
exit 1
11+
fi
12+
13+
ARGS=$(sed -e "s'\${IMG_FROM}'${IMG_FROM}'" -e "s'\${IMG_TO}'${IMG_TO}'" sconify.args)
14+
echo $ARGS
15+
16+
SCONE_IMAGE="registry.scontain.com/${SCONE_IMG_NAME}:${SCONE_IMG_VERSION}"
17+
18+
docker run -t --rm \
19+
-v /var/run/docker.sock:/var/run/docker.sock \
20+
${SCONE_IMAGE} \
21+
sconify_iexec \
22+
--cli=${SCONE_IMAGE} \
23+
--crosscompiler=${SCONE_IMAGE} \
24+
$ARGS
25+
26+
echo
27+
docker run --rm -e SCONE_HASH=1 $IMG_TO

0 commit comments

Comments
 (0)