Repository navigation
Initial dump of Compositions alpha implementation #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 @@ | ||
| # More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
| # Ignore build and test binaries. | ||
| bin/ |
This file contains hidden or 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,32 @@ | ||
| # test logs | ||
| test-logs/* | ||
|
|
||
| bin/* | ||
| expanders/bin/* | ||
|
|
||
| release/test/* | ||
|
|
||
| # Binaries for programs and plugins | ||
| *.exe | ||
| *.exe~ | ||
| *.dll | ||
| *.so | ||
| *.dylib | ||
| Dockerfile.cross | ||
|
|
||
| # Test binary, build with `go test -c` | ||
| *.test | ||
|
|
||
| # Output of the go coverage tool, specifically when used with LiteIDE | ||
| *.out | ||
|
|
||
| # Kubernetes Generated files - skip generated files, except for vendored files | ||
|
|
||
| !vendor/**/zz_generated.* | ||
|
|
||
| # editor and IDE paraphernalia | ||
| .idea | ||
| .vscode | ||
| *.swp | ||
| *.swo | ||
| *~ |
This file contains hidden or 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,50 @@ | ||
| # Copyright 2024 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| run: | ||
| deadline: 5m | ||
| allow-parallel-runners: true | ||
|
|
||
| issues: | ||
| # don't skip warning about doc comments | ||
| # don't exclude the default set of lint | ||
| exclude-use-default: false | ||
| # restore some of the defaults | ||
| # (fill in the rest as needed) | ||
| exclude-rules: | ||
| #- path: "api/*" | ||
| # linters: | ||
| # - lll | ||
| linters: | ||
| disable-all: true | ||
| enable: | ||
| - dupl | ||
| - errcheck | ||
| - exportloopref | ||
| - goconst | ||
| - gocyclo | ||
| - gofmt | ||
| - goimports | ||
| - gosimple | ||
| - govet | ||
| - ineffassign | ||
| - lll | ||
| - misspell | ||
| - nakedret | ||
| - prealloc | ||
| - staticcheck | ||
| - typecheck | ||
| - unconvert | ||
| - unparam | ||
| - unused | ||
This file contains hidden or 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,49 @@ | ||
| # Copyright 2024 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # Build the manager binary | ||
| FROM golang:1.23.2 as builder | ||
|
barney-s marked this conversation as resolved.
Resolved
|
||
| ARG TARGETOS | ||
| ARG TARGETARCH | ||
|
|
||
| WORKDIR /workspace | ||
| # Copy the Go Modules manifests | ||
| COPY go.mod go.mod | ||
| COPY go.sum go.sum | ||
| # cache deps before building and copying source so that we don't need to re-download as much | ||
| # and so that source changes don't invalidate our downloaded layer | ||
| RUN go mod download | ||
|
|
||
| # Copy the go source | ||
| COPY cmd/main.go cmd/main.go | ||
| COPY api/ api/ | ||
| COPY internal/controller/ internal/controller/ | ||
| COPY proto/ proto/ | ||
| COPY pkg/ pkg/ | ||
|
|
||
| # Build | ||
| # the GOARCH has not a default value to allow the binary be built according to the host where the command | ||
| # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO | ||
| # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, | ||
| # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. | ||
| RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go | ||
|
|
||
| # Use distroless as minimal base image to package the manager binary | ||
| # Refer to https://github.com/GoogleContainerTools/distroless for more details | ||
| FROM gcr.io/distroless/static:nonroot | ||
| WORKDIR / | ||
| COPY --from=builder /workspace/manager . | ||
| USER 65532:65532 | ||
|
|
||
| ENTRYPOINT ["/manager"] | ||
This file contains hidden or 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,42 @@ | ||
| # Copyright 2024 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| # ----------------- Build Container --------------------------- | ||
| # Build the go app. | ||
| # Explicitly set to latest vs golang:1.22 | ||
| FROM golang:1.23.2 AS build-stage | ||
|
|
||
| # Set destination for COPY | ||
| WORKDIR /go/src/app | ||
|
|
||
| # Download Go modules | ||
| # https://docs.docker.com/reference/dockerfile/#copy | ||
| COPY . ./ | ||
| RUN go mod download | ||
|
|
||
| # Build | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -v -o expander expanders/getter/main.go | ||
|
|
||
| # ----------------- Expander Container --------------------------- | ||
| #FROM marketplace.gcr.io/google/debian10:latest as bootstrap | ||
| FROM scratch as inline | ||
|
|
||
| EXPOSE 8443 | ||
|
|
||
| WORKDIR / | ||
| COPY --from=build-stage /go/src/app/expander . | ||
|
|
||
| ENTRYPOINT ["/expander"] |
This file contains hidden or 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,27 @@ | ||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| # ----------------- Build Container --------------------------- | ||
| # Build the go app. | ||
| FROM golang:1.23.2 AS build-stage | ||
|
|
||
| # Set destination for COPY | ||
| WORKDIR /go/src/app | ||
|
|
||
| # Download Go modules | ||
| # https://docs.docker.com/reference/dockerfile/#copy | ||
| COPY go.mod go.sum ./ | ||
| COPY ./cmd/inline/main.go ./ | ||
|
barney-s marked this conversation as resolved.
Resolved
|
||
| RUN go mod download | ||
|
|
||
| # Build | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -v -o inline main.go | ||
|
|
||
| # ----------------- Final Container --------------------------- | ||
| #FROM marketplace.gcr.io/google/debian10:latest as bootstrap | ||
| FROM scratch as inline | ||
|
|
||
| WORKDIR /root | ||
|
|
||
| COPY --from=build-stage /go/src/app/inline . | ||
|
|
||
| ENTRYPOINT ["/root/inline"] | ||
This file contains hidden or 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,51 @@ | ||
| # Copyright 2024 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| # ----------------- Build Container --------------------------- | ||
| # Build the go app. | ||
| # Explicitly set to latest vs golang:1.22 | ||
| FROM golang:1.23.2 AS build-stage | ||
|
|
||
| # Set destination for COPY | ||
| WORKDIR /go/src/app | ||
|
|
||
| # Download Go modules | ||
| # https://docs.docker.com/reference/dockerfile/#copy | ||
| COPY go.mod go.sum ./ | ||
| COPY ./expanders ./expanders | ||
| COPY ./proto ./proto | ||
| RUN go mod download | ||
|
|
||
| # Build | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -v -o expander expanders/jinja2/main.go | ||
|
|
||
| # ----------------- Expander Container --------------------------- | ||
| FROM python:3.7-slim as expander | ||
|
|
||
| EXPOSE 50051 | ||
|
|
||
| WORKDIR / | ||
| COPY --from=build-stage /go/src/app/expander . | ||
|
|
||
|
|
||
| COPY ./expanders/jinja2/requirements.txt ./ | ||
| RUN pip install --require-hashes -r requirements.txt | ||
| COPY ./expanders/jinja2/parse_template.py ./ | ||
|
|
||
| # Required when setting pod .spec.securityContext.runAsNonRoot: true | ||
| #USER 65532:65532 | ||
|
|
||
| ENTRYPOINT ["jinja2"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.