-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from comrade-coop/xx-development-env
Improve development environment + minor fixes
- Loading branch information
Showing
68 changed files
with
1,606 additions
and
1,441 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,22 @@ | ||
name: Check Python code | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**/Tiltfile' | ||
- '**.py' | ||
- '.github/workflows/check-py.yml' | ||
|
||
jobs: | ||
check-fmt: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Check format | ||
uses: psf/black@stable | ||
with: | ||
options: '--line-length 100 --include Tiltfile --check' |
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 |
---|---|---|
|
@@ -2,59 +2,73 @@ | |
|
||
## common: ## | ||
|
||
FROM docker.io/library/golang:1.22.6@sha256:367bb5295d3103981a86a572651d8297d6973f2ec8b62f716b007860e22cbc25 as build-common | ||
# 1.21-bookworm | ||
FROM docker.io/library/golang:1.23.1-bookworm@sha256:1a5326b07cbab12f4fd7800425f2cf25ff2bd62c404ef41b56cb99669a710a83 as build-dependencies | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y protobuf-compiler libgpgme-dev && rm -rf /var/lib/apt/lists/* | ||
RUN go install google.golang.org/protobuf/cmd/[email protected] && go install google.golang.org/grpc/cmd/[email protected] && go install github.com/ethereum/go-ethereum/cmd/[email protected] | ||
RUN go install google.golang.org/protobuf/cmd/[email protected] && go install google.golang.org/grpc/cmd/[email protected] && go install github.com/ethereum/go-ethereum/cmd/[email protected] | ||
|
||
FROM build-dependencies AS build-common | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download && go mod verify | ||
RUN --mount=type=cache,target=/root/.cache/go-build go mod download && go mod verify | ||
|
||
COPY pkg ./pkg | ||
|
||
FROM docker.io/debian@sha256:2bc5c236e9b262645a323e9088dfa3bb1ecb16cc75811daf40a23a824d665be9 as run-common | ||
# bookworm-slim, bookworm-20231120-slim matching golang:1.21-bookworm | ||
FROM docker.io/debian:bookworm-20240904-slim@sha256:a629e796d77a7b2ff82186ed15d01a493801c020eed5ce6adaa2704356f15a1c as run-common | ||
# matching golang:1.23.1-bookworm above | ||
|
||
RUN apt-get update && apt-get install -y libgpgme11 curl jq && rm -rf /var/lib/apt/lists/* | ||
|
||
## p2p-helper: ## | ||
|
||
FROM build-common as build-p2p-helper | ||
FROM build-common AS build-p2p-helper | ||
|
||
COPY cmd/ipfs-p2p-helper ./cmd/ipfs-p2p-helper | ||
RUN --mount=type=cache,target=/root/.cache/go-build go build -v -o /usr/local/bin/ipfs-p2p-helper ./cmd/ipfs-p2p-helper | ||
|
||
FROM run-common as p2p-helper | ||
FROM run-common AS p2p-helper | ||
|
||
COPY --from=build-p2p-helper /usr/local/bin/ipfs-p2p-helper /usr/local/bin/ipfs-p2p-helper | ||
|
||
ENTRYPOINT ["ipfs-p2p-helper"] | ||
|
||
FROM run-common AS p2p-helper-copy-local | ||
|
||
COPY ./bin/ipfs-p2p-helper /usr/local/bin/ipfs-p2p-helper | ||
|
||
ENTRYPOINT ["ipfs-p2p-helper"] | ||
|
||
## server: ## | ||
|
||
FROM build-common as build-server | ||
FROM build-common AS build-server | ||
|
||
COPY cmd/tpodserver ./cmd/tpodserver | ||
RUN --mount=type=cache,target=/root/.cache/go-build go build -v -o /usr/local/bin/tpodserver ./cmd/tpodserver | ||
# RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=bind,source=.,target=/app go build -v -o /usr/local/bin/tpodserver ./cmd/tpodserver | ||
|
||
FROM run-common as server | ||
FROM run-common AS server | ||
|
||
COPY --from=build-server /usr/local/bin/tpodserver /usr/local/bin/tpodserver | ||
|
||
ENTRYPOINT ["tpodserver"] | ||
|
||
FROM run-common AS server-copy-local | ||
|
||
COPY ./bin/tpodserver /usr/local/bin/tpodserver | ||
|
||
ENTRYPOINT ["tpodserver"] | ||
|
||
## autoscaler: ## | ||
|
||
FROM build-common as build-autoscaler | ||
FROM build-common AS build-autoscaler | ||
|
||
COPY autoscaler ./autoscaler | ||
RUN --mount=type=cache,target=/root/.cache/go-build go build -v -o /usr/local/bin/autoscaler ./autoscaler | ||
|
||
FROM run-common as autoscaler | ||
FROM run-common AS autoscaler | ||
|
||
COPY --from=build-autoscaler /usr/local/bin/autoscaler /usr/local/bin/autoscaler | ||
|
||
|
@@ -72,3 +86,9 @@ FROM run-common as tpod-proxy | |
COPY --from=build-tpod-proxy /usr/local/bin/tpod-proxy /usr/local/bin/tpod-proxy | ||
|
||
ENTRYPOINT ["tpod-proxy"] | ||
|
||
FROM run-common AS tpod-proxy-copy-local | ||
|
||
COPY ./bin/proxy /usr/local/bin/tpod-proxy | ||
|
||
ENTRYPOINT ["tpod-proxy"] |
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,30 @@ | ||
# -*- mode: Python -*- | ||
# SPDX-License-Identifier: GPL-3.0 | ||
|
||
|
||
config.define_string_list("include") | ||
config.define_string("allow-context") | ||
config.define_bool("deploy-stack") | ||
cfg = config.parse() | ||
|
||
if "allow-context" in cfg: | ||
allow_k8s_contexts(cfg["allow-context"]) | ||
|
||
load( | ||
"./deploy/Tiltfile", | ||
"apocryph_resource", | ||
"apocryph_build_with_builder", | ||
"deploy_apocryph_stack", | ||
"deploy_apocryph_local", | ||
) | ||
|
||
if cfg.get("deploy-stack", True): | ||
apocryph_build_with_builder() | ||
deploy_apocryph_stack() | ||
deploy_apocryph_local() | ||
else: | ||
apocryph_build_with_builder(skip_images=True) | ||
deploy_apocryph_local(resource_deps=[]) | ||
|
||
for f in cfg.get("include", []): | ||
load_dynamic(f) |
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 @@ | ||
/keys/ |
Oops, something went wrong.