This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating persistent configuration, but keeping config in Dockerfile a…
…nd not in github
- Loading branch information
Showing
11 changed files
with
126 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Build docker | ||
on: | ||
push: | ||
|
||
jobs: | ||
# This is copied from https://docs.github.com/en/actions/publishing-packages/publishing-docker-images | ||
build-and-push-image: | ||
runs-on: ubuntu-22.04 | ||
if: false | ||
permissions: | ||
contents: write | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Build requirements | ||
run: | | ||
sudo apt install -y protobuf-compiler | ||
rm -rf backend/{configs,build} | ||
make configs webapp-proto | ||
git config --global user.name "Build Workflow" | ||
git config --global user.email "[email protected]" | ||
git add backend/configs | ||
git commit -am "Configs generated on $( date )" | ||
git push | ||
- name: Build and push Docker image for nodes | ||
# id: build-and-push-backend | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: backend | ||
push: true | ||
tags: ghcr.io/c4dt/service-stainless-backend:latest | ||
|
||
- name: Build and push Docker image | ||
# id: build-and-push-webapp | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: webapp | ||
push: true | ||
tags: ghcr.io/c4dt/service-stainless-webapp:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/build/ | ||
/configs/ | ||
/cothority/ | ||
/proto/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
FROM golang:1 as builder | ||
FROM golang:1.20 as builder | ||
|
||
COPY build/*.go build/go.* /src/main/ | ||
COPY *.go go.* /backend/ | ||
COPY cothority/ /backend/cothority/ | ||
COPY proto/ /backend/proto/ | ||
COPY stainless/ /backend/stainless/ | ||
COPY *.go go.* cothority proto stainless /src/ | ||
|
||
RUN cd /src/main && go build -v -o /conode | ||
|
||
COPY build/stainless.zip /tmp/ | ||
RUN unzip -d /stainless /tmp/stainless.zip | ||
|
||
FROM debian:bookworm-slim as runner | ||
|
||
# libgomp is needed for z3 | ||
|
@@ -23,9 +23,6 @@ RUN npm install --global [email protected] | |
|
||
COPY build/cvc4 /usr/local/bin/ | ||
|
||
COPY build/stainless.zip /tmp/ | ||
RUN unzip -d /usr/local/bin /tmp/stainless.zip && rm -f /tmp/stainless.zip | ||
|
||
COPY --from=builder /conode /usr/local/bin/conode | ||
COPY --from=builder /conode /stainless/* /usr/local/bin/ | ||
|
||
ENTRYPOINT ["/usr/local/bin/conode"] | ||
CMD /usr/local/bin/conode -d 2 -c /config/private.toml server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM ghcr.io/c4dt/service-stainless-backend | ||
|
||
COPY configs /configs/ | ||
|
||
ENV NODE_NBR | ||
|
||
CMD ( test -f /config/private.toml || cp -a /configs/conode-$NODE_NBR/* /config ); /usr/local/bin/conode -d 2 -c /config/private.toml server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/node_modules/ | ||
/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters