Skip to content

Commit

Permalink
chore: Remove License checker (#11609)
Browse files Browse the repository at this point in the history
* update dependencies

Signed-off-by: Humair Khan <[email protected]>

* remove license checking

Signed-off-by: Humair Khan <[email protected]>

---------

Signed-off-by: Humair Khan <[email protected]>
  • Loading branch information
HumairAK authored Feb 10, 2025
1 parent 42fc132 commit c100648
Show file tree
Hide file tree
Showing 23 changed files with 203 additions and 1,407 deletions.
11 changes: 0 additions & 11 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,11 @@ WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./
COPY ./hack/install-go-licenses.sh ./hack/

RUN GO111MODULE=on go mod download
RUN ./hack/install-go-licenses.sh

COPY . .
RUN GO111MODULE=on go build -o /bin/apiserver backend/src/apiserver/*.go
# Check licenses and comply with license terms.
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/apiserver
RUN go-licenses csv ./backend/src/apiserver > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/apiserver.csv && \
go-licenses save ./backend/src/apiserver --save_path /tmp/NOTICES

# 2. Compile preloaded pipeline samples
FROM python:3.9 as compiler
Expand Down Expand Up @@ -73,9 +65,6 @@ WORKDIR /bin
COPY backend/src/apiserver/config/ /config
COPY --from=builder /bin/apiserver /bin/apiserver

# Copy licenses and notices.
COPY --from=builder /tmp/licenses.csv /third_party/licenses.csv
COPY --from=builder /tmp/NOTICES /third_party/NOTICES
COPY --from=compiler /samples/ /samples/
RUN chmod +x /bin/apiserver

Expand Down
12 changes: 0 additions & 12 deletions backend/Dockerfile.cacheserver
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,13 @@ WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./
COPY ./hack/install-go-licenses.sh ./hack/

RUN GO111MODULE=on go mod download
RUN ./hack/install-go-licenses.sh

COPY . .

RUN GO111MODULE=on go build -o /bin/cache_server backend/src/cache/*.go

# Check licenses and comply with license terms.
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/cache
RUN go-licenses csv ./backend/src/cache > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/cache_server.csv && \
go-licenses save ./backend/src/cache --save_path /tmp/NOTICES

FROM alpine:3.19

RUN adduser -S appuser
Expand All @@ -46,8 +37,5 @@ USER appuser
WORKDIR /bin

COPY --from=builder /bin/cache_server /bin/cache_server
# Copy licenses and notices.
COPY --from=builder /tmp/licenses.csv /third_party/licenses.csv
COPY --from=builder /tmp/NOTICES /third_party/NOTICES

ENTRYPOINT [ "/bin/cache_server" ]
12 changes: 0 additions & 12 deletions backend/Dockerfile.driver
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,13 @@ WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./
COPY ./hack/install-go-licenses.sh ./hack/

RUN GO111MODULE=on go mod download
RUN ./hack/install-go-licenses.sh

COPY . .

RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -gcflags="${GCFLAGS}" -ldflags '-extldflags "-static"' -o /bin/driver ./backend/src/v2/cmd/driver/*.go

# Check licenses and comply with license terms.
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/v2/cmd/driver
RUN go-licenses csv ./backend/src/v2/cmd/driver > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/driver.csv && \
go-licenses save ./backend/src/v2/cmd/driver --save_path /tmp/NOTICES

FROM alpine:3.19

RUN adduser -S appuser
Expand All @@ -44,8 +35,5 @@ USER appuser
WORKDIR /bin

COPY --from=builder /bin/driver /bin/driver
# Copy licenses and notices.
COPY --from=builder /tmp/licenses.csv /third_party/licenses.csv
COPY --from=builder /tmp/NOTICES /third_party/NOTICES

ENTRYPOINT [ "/bin/driver" ]
12 changes: 0 additions & 12 deletions backend/Dockerfile.launcher
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,13 @@ WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./
COPY ./hack/install-go-licenses.sh ./hack/

RUN GO111MODULE=on go mod download
RUN ./hack/install-go-licenses.sh

COPY . .

RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-extldflags "-static"' -o /bin/launcher-v2 ./backend/src/v2/cmd/launcher-v2/*.go

# Check licenses and comply with license terms.
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/v2/cmd/launcher-v2
RUN go-licenses csv ./backend/src/v2/cmd/launcher-v2 > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/launcher.csv && \
go-licenses save ./backend/src/v2/cmd/launcher-v2 --save_path /tmp/NOTICES

FROM alpine:3.19

RUN adduser -S appuser
Expand All @@ -42,8 +33,5 @@ USER appuser
WORKDIR /bin

COPY --from=builder /bin/launcher-v2 /bin/launcher-v2
# Copy licenses and notices.
COPY --from=builder /tmp/licenses.csv /third_party/licenses.csv
COPY --from=builder /tmp/NOTICES /third_party/NOTICES

ENTRYPOINT [ "/bin/launcher-v2" ]
12 changes: 0 additions & 12 deletions backend/Dockerfile.persistenceagent
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./
COPY ./hack/install-go-licenses.sh ./hack/

RUN GO111MODULE=on go mod download
RUN ./hack/install-go-licenses.sh

COPY . .

Expand All @@ -30,12 +28,6 @@ RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev

RUN GO111MODULE=on go build -o /bin/persistence_agent backend/src/agent/persistence/*.go
# Check licenses and comply with license terms.
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/agent/persistence
RUN go-licenses csv ./backend/src/agent/persistence > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/persistence_agent.csv && \
go-licenses save ./backend/src/agent/persistence --save_path /tmp/NOTICES

FROM alpine:3.19

Expand All @@ -45,10 +37,6 @@ USER appuser
WORKDIR /bin

COPY --from=builder /bin/persistence_agent /bin/persistence_agent
# Copy licenses and notices.
COPY --from=builder /tmp/licenses.csv /third_party/licenses.csv
COPY --from=builder /tmp/NOTICES /third_party/NOTICES

ENV NAMESPACE ""

# Set Workflow TTL to 1 day. The way to use a different value for a particular Kubeflow Pipelines deployment is demonstrated in manifests/kustomize/base/pipeline/ml-pipeline-persistenceagent-deployment.yaml
Expand Down
12 changes: 0 additions & 12 deletions backend/Dockerfile.scheduledworkflow
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./
COPY ./hack/install-go-licenses.sh ./hack/

RUN GO111MODULE=on go mod download
RUN ./hack/install-go-licenses.sh

COPY . .

Expand All @@ -30,12 +28,6 @@ RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev

RUN GO111MODULE=on go build -o /bin/controller backend/src/crd/controller/scheduledworkflow/*.go
# Check licenses and comply with license terms.
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/crd/controller/scheduledworkflow
RUN go-licenses csv ./backend/src/crd/controller/scheduledworkflow > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/swf.csv && \
go-licenses save ./backend/src/crd/controller/scheduledworkflow --save_path /tmp/NOTICES

FROM alpine:3.19

Expand All @@ -47,10 +39,6 @@ USER appuser
WORKDIR /bin

COPY --from=builder /bin/controller /bin/controller
# Copy licenses and notices.
COPY --from=builder /tmp/licenses.csv /third_party/licenses.csv
COPY --from=builder /tmp/NOTICES /third_party/NOTICES

ENV NAMESPACE ""
ENV LOG_LEVEL info

Expand Down
11 changes: 0 additions & 11 deletions backend/Dockerfile.viewercontroller
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,19 @@ WORKDIR /src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./
COPY ./hack/install-go-licenses.sh ./hack/

RUN GO111MODULE=on go mod download
RUN ./hack/install-go-licenses.sh

COPY . .

RUN GO111MODULE=on go build -o /bin/controller backend/src/crd/controller/viewer/*.go
# Check licenses and comply with license terms.
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/crd/controller/viewer
RUN go-licenses csv ./backend/src/crd/controller/viewer > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/viewer.csv && \
go-licenses save ./backend/src/crd/controller/viewer --save_path /tmp/NOTICES

FROM alpine
WORKDIR /bin

COPY --from=builder /bin/controller /bin/controller
RUN chmod +x /bin/controller

# Copy licenses and notices.
COPY --from=builder /tmp/licenses.csv /third_party/licenses.csv
COPY --from=builder /tmp/NOTICES /third_party/NOTICES

ENV MAX_NUM_VIEWERS "50"
ENV NAMESPACE "kubeflow"
Expand Down
41 changes: 1 addition & 40 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,12 @@ IMG_TAG_LAUNCHER ?= kfp-launcher
# Whenever build command for any of the binaries change, we should update them both here and in backend/Dockerfiles.

.PHONY: all
all: license_apiserver license_persistence_agent license_cache_server license_swf license_viewer license_driver license_launcher
all: image_all

.PHONY: clean
clean:
rm -rf $(BUILD)

$(BUILD)/apiserver:
GO111MODULE=on go build -o $(BUILD)/apiserver github.com/kubeflow/pipelines/backend/src/apiserver
$(BUILD)/persistence_agent:
GO111MODULE=on go build -o $(BUILD)/persistence_agent github.com/kubeflow/pipelines/backend/src/agent/persistence
$(BUILD)/cache_server:
GO111MODULE=on go build -o $(BUILD)/cache_server github.com/kubeflow/pipelines/backend/src/cache
$(BUILD)/swf:
GO111MODULE=on go build -o $(BUILD)/swf github.com/kubeflow/pipelines/backend/src/crd/controller/scheduledworkflow
$(BUILD)/viewer:
GO111MODULE=on go build -o $(BUILD)/viewer github.com/kubeflow/pipelines/backend/src/crd/controller/viewer
$(BUILD)/driver:
GO111MODULE=on go build -o $(BUILD)/driver github.com/kubeflow/pipelines/backend/src/v2/cmd/driver
$(BUILD)/launcher:
GO111MODULE=on go build -o $(BUILD)/launcher github.com/kubeflow/pipelines/backend/src/v2/cmd/launcher-v2

# Update licenses info after dependencies changed.
# See README.md#updating-licenses-info section for more details.
.PHONY: license_apiserver
license_apiserver: $(BUILD)/apiserver
cd $(MOD_ROOT) && go-licenses csv ./backend/src/apiserver > $(CSV_PATH)/apiserver.csv
.PHONY: license_persistence_agent
license_persistence_agent: $(BUILD)/persistence_agent
cd $(MOD_ROOT) && go-licenses csv ./backend/src/agent/persistence > $(CSV_PATH)/persistence_agent.csv
.PHONY: license_cache_server
license_cache_server: $(BUILD)/cache_server
cd $(MOD_ROOT) && go-licenses csv ./backend/src/cache > $(CSV_PATH)/cache_server.csv
.PHONY: license_swf
license_swf: $(BUILD)/swf
cd $(MOD_ROOT) && go-licenses csv ./backend/src/crd/controller/scheduledworkflow > $(CSV_PATH)/swf.csv
.PHONY: license_viewer
license_viewer: $(BUILD)/viewer
cd $(MOD_ROOT) && go-licenses csv ./backend/src/crd/controller/viewer > $(CSV_PATH)/viewer.csv
.PHONY: license_driver
license_driver: $(BUILD)/driver
cd $(MOD_ROOT) && go-licenses csv ./backend/src/v2/cmd/driver > $(CSV_PATH)/driver.csv
.PHONY: license_launcher
license_launcher: $(BUILD)/launcher
cd $(MOD_ROOT) && go-licenses csv ./backend/src/v2/cmd/launcher-v2 > $(CSV_PATH)/launcher.csv

.PHONY: image_all
image_all: image_apiserver image_persistence_agent image_cache image_swf image_viewer image_visualization image_driver image_launcher

Expand Down
11 changes: 0 additions & 11 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This README will help you set up your coding environment in order to build and r
## Prerequisites
Before you begin, ensure you have:
- Go programming language installed
- [go-licenses tool](../hack/install-go-licenses.sh)
- Docker or Podman installed (for building container images)

Note that you may need to restart your shell after installing these resources in order for the changes to take effect.
Expand Down Expand Up @@ -50,16 +49,6 @@ Change it to point to your own build, after saving and closing the file, apiserv
After making changes to proto files, the Go client libraries, Python client libraries and swagger files
need to be regenerated and checked-in. Refer to [backend/api](./api/README.md) for details.

### Updating licenses info

1. [Install go-licenses tool](../hack/install-go-licenses.sh) (if you haven't already) and refer to [its documentation](https://github.com/google/go-licenses) for how to use it.

2. Run the tool to update all licenses:

```bash
make -C backend all
```

### Updating python dependencies

[pip-tools](https://github.com/jazzband/pip-tools) is used to manage python
Expand Down
2 changes: 0 additions & 2 deletions backend/src/v2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ REPO_ROOT=../../..
GOOS_VALUE?=linux
GOARCH_VALUE?=amd64
# override this via env to increase verbosity of go-licenses, example:
# GO_LICENSES_FLAGS=-v4 make license-launcher
GO_LICENSES_FLAGS?=
GO_FLAGS=GO111MODULE=on CGO_ENABLED=0 GOOS=${GOOS_VALUE} GOARCH=${GOARCH_VALUE}
GO_BUILD_FLAGS=-tags netgo -ldflags '-extldflags "-static"'
KO_VERSION?=v0.8.3
Expand Down
26 changes: 0 additions & 26 deletions backend/src/v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,29 +115,3 @@ Instructions:
```
Read [v2 sample test documentation](./test/README.md) for more details.
### Update licenses
Note, this is currently outdated instructions for v2 compatible mode. We haven't set up licensing workflow for v2 engine.

Download the license tool binary from <https://github.com/Bobgy/go-licenses/releases> and put it into $PATH.

Update licenses info by:

```bash
make license-launcher
```

or run the following to enable verbose output:

```bash
GO_LICENSES_FLAGS=-v4 make license-launcher
```

After the update, check generated third_party/licenses/launcher.csv file to
make sure licenses of new dependencies are correctly identified.

If something is unexpected, examine the unexpected dependencies by yourself and add
overrides to [go-licenses.yaml](./go-licenses.yaml).

For detailed documentation about the tool: <https://github.com/Bobgy/go-licenses/tree/main/v2>.
6 changes: 0 additions & 6 deletions backend/src/v2/test/presubmit-v2-go-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,3 @@ kubectl port-forward svc/metadata-grpc-service 8080:8080 -n "$NAMESPACE" & PORT_
# wait for kubectl port forward
sleep 10
go test -v -cover ./...

# TODO(zijianjoy): re-enable license check for v2 images
# verify licenses are up-to-date, because all license updates must be reviewed by a human.
# ../hack/install-go-licenses.sh
# make license-launcher
# git diff --exit-code -- third_party/licenses/launcher.csv || (echo "v2/third_party/licenses/launcher.csv is outdated, refer to https://github.com/kubeflow/pipelines/tree/master/v2#update-licenses for update instructions.")
Loading

0 comments on commit c100648

Please sign in to comment.