-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into re-test-snap-data-change
- Loading branch information
Showing
10 changed files
with
174 additions
and
66 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
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,73 @@ | ||
name: zcash-lightwalletd | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- 'zebra-rpc/**' | ||
- 'zebrad/tests/acceptance.rs' | ||
- 'zebrad/src/config.rs' | ||
- 'zebrad/src/commands/start.rs' | ||
- 'docker/zcash-lightwalletd/Dockerfile' | ||
- '.github/workflows/zcash-lightwalletd.yml' | ||
|
||
env: | ||
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | ||
GAR_BASE: us-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/zebra | ||
GCR_BASE: gcr.io/${{ secrets.GCP_PROJECT_ID }} | ||
IMAGE_NAME: lightwalletd | ||
|
||
jobs: | ||
build: | ||
name: Build images | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2.4.0 | ||
with: | ||
repository: adityapk00/lightwalletd | ||
ref: 'master' | ||
persist-credentials: false | ||
|
||
- uses: actions/checkout@v2.4.0 | ||
with: | ||
path: zebra | ||
persist-credentials: false | ||
|
||
- name: Inject slug/short variables | ||
uses: rlespinasse/github-slug-action@v4 | ||
|
||
# Setup gcloud CLI | ||
- name: Authenticate to Google Cloud | ||
id: auth | ||
uses: google-github-actions/auth@v0.6.0 | ||
with: | ||
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} | ||
|
||
# Setup Docker Buildx to allow use of docker cache layers from GH | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to Google Artifact Registry | ||
uses: docker/login-action@v1.12.0 | ||
with: | ||
registry: us-docker.pkg.dev | ||
username: _json_key | ||
password: ${{ secrets.GOOGLE_CREDENTIALS }} | ||
|
||
# Build and push image to Google Artifact Registry | ||
- name: Build & push | ||
id: docker_build | ||
uses: docker/build-push-action@v2.9.0 | ||
with: | ||
target: builder | ||
context: . | ||
file: ./zebra/docker/zcash-lightwalletd/Dockerfile | ||
tags: | | ||
${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:latest | ||
${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:${{ env.GITHUB_SHA_SHORT }} | ||
push: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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 was deleted.
Oops, something went wrong.
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,61 @@ | ||
ARG ZCASHD_CONF_PATH=/etc/zcash.conf | ||
ARG LWD_GRPC_PORT=9067 | ||
ARG LWD_HTTP_PORT=9068 | ||
|
||
## | ||
## Build | ||
## | ||
FROM golang:1.17 AS build | ||
|
||
# Create and change to the app directory. | ||
WORKDIR /app | ||
|
||
# Retrieve application dependencies. | ||
# This allows the container build to reuse cached dependencies. | ||
# Expecting to copy go.mod and if present go.sum. | ||
COPY go.mod ./ | ||
COPY go.sum ./ | ||
|
||
# Do not use `go get` as it updates the requirements listed in your go.mod file. | ||
# `go mod download` does not add new requirements or update existing requirements. | ||
RUN go mod download | ||
|
||
# Copy local code to the container image. | ||
COPY . ./ | ||
|
||
# Build and install the binary. | ||
RUN go build -v -o /lightwalletd | ||
|
||
ARG ZCASHD_CONF_PATH | ||
|
||
RUN set -ex; \ | ||
{ \ | ||
echo "rpcuser=zcashrpc"; \ | ||
echo "rpcpassword=`head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo ''`" \ | ||
echo "rpcbind=127.0.0.1"; \ | ||
echo "rpcport=8232"; \ | ||
} > "${ZCASHD_CONF_PATH}" | ||
|
||
ENTRYPOINT ["/lightwalletd"] | ||
CMD ["--no-tls-very-insecure", "--grpc-bind-addr=0.0.0.0:9067", "--http-bind-addr=0.0.0.0:9068", "--log-file=/dev/stdout", "--log-level=7"] | ||
|
||
## | ||
## Deploy | ||
## | ||
FROM debian:bullseye-slim as runtime | ||
|
||
ARG ZCASHD_CONF_PATH | ||
# Maintain backward compatibility with mainstream repo using this ARGs in docker-compose | ||
ARG LWD_GRPC_PORT | ||
ARG LWD_HTTP_PORT | ||
|
||
WORKDIR / | ||
|
||
COPY --from=build /lightwalletd /usr/local/bin | ||
COPY --from=build $ZCASHD_CONF_PATH ./ | ||
|
||
EXPOSE 9067 | ||
EXPOSE 9068 | ||
|
||
ENTRYPOINT ["lightwalletd"] | ||
CMD ["--no-tls-very-insecure", "--grpc-bind-addr=0.0.0.0:9067", "--http-bind-addr=0.0.0.0:9068", "--log-file=/dev/stdout", "--log-level=7"] |
File renamed without changes.
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