Skip to content
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

Delete serverless and runtime from components #856

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b1d8867
Delete serverless and runtime from components
MichalKalke Apr 5, 2024
0b40eac
Delete unused serverless_types fields, tests dir
MichalKalke Apr 5, 2024
2f5d515
Delete unused things
MichalKalke Apr 5, 2024
9f04fad
remove unused serverless configs
anoipm Apr 5, 2024
daef06c
Copy secret controller
MichalKalke Apr 8, 2024
f303cfa
Copy shared file
MichalKalke Apr 8, 2024
e0c6625
Add missing files, shared, resource
MichalKalke Apr 8, 2024
595391f
fix secret_service import
MichalKalke Apr 8, 2024
99ba4fc
fix imports
MichalKalke Apr 8, 2024
05c3260
Adjust main for secret controller
MichalKalke Apr 8, 2024
ac461e6
Copy namespace
MichalKalke Apr 8, 2024
b096a66
Copy configmap and serviceaccout service
MichalKalke Apr 8, 2024
28e12f0
Cleanup dependabot and secret_service from serverless
MichalKalke Apr 8, 2024
143939d
Cleanup gh actions
MichalKalke Apr 8, 2024
f78ae13
Renaming serverless to dockerregistry
MichalKalke Apr 8, 2024
83c9845
adjust rbacs
anoipm Apr 8, 2024
d454f71
Checking for dockerregistry
MichalKalke Apr 9, 2024
a34beda
Rename operator to dockerregistry-operator
MichalKalke Apr 9, 2024
f0401af
Rename components/operator Makefile
MichalKalke Apr 9, 2024
900e66c
Cleanup makefiles
MichalKalke Apr 9, 2024
955bdaa
Remove replace_serverless_chart_images
MichalKalke Apr 9, 2024
10eb7f6
rename serverless->dockerregistry in served state function
anoipm Apr 9, 2024
519dbef
rename serverless->dockerregistry in init state
anoipm Apr 9, 2024
fd0a12a
rename serverless->dockerregistry in states
anoipm Apr 9, 2024
b58257a
rename serverless->dockerregistry in code (part)
anoipm Apr 11, 2024
68468ae
Remove images of serverless and delete prio class from values.yaml
MichalKalke Apr 11, 2024
9c815e9
Cleanup values.yaml from unused status fields and serverless webhook
MichalKalke Apr 11, 2024
3add609
Remove unused fields form status
MichalKalke Apr 11, 2024
b481296
fix integration test
anoipm Apr 12, 2024
f111524
Remove unused fields form values.yaml v2
MichalKalke Apr 12, 2024
5d6e8ad
Rename serverless-docker-reg to internal-docker-reg
MichalKalke Apr 12, 2024
cbb089e
Rename serverless to dockerregistry
MichalKalke Apr 15, 2024
92c8654
rename serverless->dockerregistry in code (part)
anoipm Apr 15, 2024
3e2dca3
rename serverless->dockerregistry in code (part)
anoipm Apr 15, 2024
bca833f
rename serverless->dockerregistry in code (part)
anoipm Apr 15, 2024
682678e
remove not needed spec params and unused status fields
anoipm Apr 15, 2024
d466d58
adjust default-dockerregistry-cr
anoipm Apr 17, 2024
273f941
remove (comment) unused parts from values.yaml
anoipm Apr 18, 2024
e43ee15
cleanup values.yaml
anoipm Apr 18, 2024
b4640a5
cleanup _helpers.tpl; fix tests
anoipm Apr 18, 2024
19f27cc
rename config/serverless -> config/docker-registry
anoipm Apr 18, 2024
132e5c1
fix controller test
anoipm Apr 18, 2024
455968d
rename dockerregistry-operator
anoipm Apr 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
99 changes: 0 additions & 99 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,102 +36,3 @@ updates:
prefix: "operator"
include: "scope"

- package-ecosystem: "docker"
directory: "/components/serverless/deploy/jobinit"
labels:
- "area/dependency"
- "kind/chore"
schedule:
interval: "weekly"
commit-message:
prefix: "jobinit"
include: "scope"
- package-ecosystem: "docker"
directory: "/components/serverless/deploy/manager"
labels:
- "area/dependency"
- "kind/chore"
schedule:
interval: "weekly"
commit-message:
prefix: "manager"
include: "scope"

- package-ecosystem: "docker"
directory: "/tests/gitserver"
labels:
- "area/dependency"
- "kind/chore"
schedule:
interval: "weekly"
commit-message:
prefix: "gitserver"
include: "scope"

- package-ecosystem: "pip"
directory: "/components/runtimes/python/python39"
labels:
- "area/dependency"
- "kind/chore"
schedule:
interval: "weekly"
commit-message:
prefix: "pip-python39"
include: "scope"
groups:
opentelemetry:
patterns:
- "opentelemetry-*"
- package-ecosystem: "pip"
directory: "/components/runtimes/python/python312"
labels:
- "area/dependency"
- "kind/chore"
schedule:
interval: "weekly"
commit-message:
prefix: "pip-python312"
include: "scope"
groups:
opentelemetry:
patterns:
- "opentelemetry-*"

- package-ecosystem: "npm"
directory: "/components/runtimes/nodejs/nodejs18"
labels:
- "area/dependency"
- "kind/chore"
schedule:
interval: "weekly"
commit-message:
prefix: "npm-nodejs18"
include: "scope"
groups:
opentelemetry:
patterns:
- "@opentelemetry/*"
- package-ecosystem: "npm"
directory: "/components/runtimes/nodejs/nodejs20"
labels:
- "area/dependency"
- "kind/chore"
schedule:
interval: "weekly"
commit-message:
prefix: "npm-nodejs20"
include: "scope"
groups:
opentelemetry:
patterns:
- "@opentelemetry/*"
- package-ecosystem: "npm"
directory: "/tests/gitserver/repos/function"
labels:
- "area/dependency"
- "kind/chore"
schedule:
interval: "weekly"
commit-message:
prefix: "npm-test"
include: "scope"
10 changes: 5 additions & 5 deletions .github/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ uploadFile() {
echo "IMG: ${IMG}"
IMG=${IMG} make -C components/operator/ render-manifest

echo "Generated serverless-operator.yaml:"
cat serverless-operator.yaml
echo "Generated dockerregistry-operator.yaml:"
cat dockerregistry-operator.yaml

echo "Fetching releases"
CURL_RESPONSE=$(curl -w "%{http_code}" -sL \
Expand All @@ -62,9 +62,9 @@ fi
echo "Updating github release with assets"
UPLOAD_URL="https://uploads.github.com/repos/kyma-project/serverless/releases/${RELEASE_ID}/assets"

uploadFile "serverless-operator.yaml" "${UPLOAD_URL}?name=serverless-operator.yaml"
uploadFile "config/samples/default-serverless-cr.yaml" "${UPLOAD_URL}?name=default-serverless-cr.yaml"
uploadFile "config/samples/default-serverless-cr-k3d.yaml" "${UPLOAD_URL}?name=default-serverless-cr-k3d.yaml"
uploadFile "dockerregistry-operator.yaml" "${UPLOAD_URL}?name=dockerregistry-operator.yaml"
uploadFile "config/samples/default-dockerregistry-cr.yaml" "${UPLOAD_URL}?name=default-dockerregistry-cr.yaml"
uploadFile "config/samples/default-dockerregistry-cr-k3d.yaml" "${UPLOAD_URL}?name=default-dockerregistry-cr-k3d.yaml"



6 changes: 3 additions & 3 deletions .github/scripts/upgrade-sec-scanners-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ yq eval-all --inplace '
| .global.containerRegistry.path as $registryPath
| (
{
"serverless_operator" : {
"name" : "serverless-operator",
"dockerregistry_operator" : {
"name" : "dockerregistry-operator",
"directory" : "prod",
"version" : env(IMG_VERSION)
}
Expand All @@ -19,4 +19,4 @@ yq eval-all --inplace '
| $registryPath + "/" + .directory + "/" + .name + ":" + .version
]
| select(fileIndex == 0)
' sec-scanners-config.yaml config/serverless/values.yaml
' sec-scanners-config.yaml config/docker-registry/values.yaml
8 changes: 0 additions & 8 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ jobs:
token: ${{ secrets.BOT_TOKEN }}
fetch-depth: 0

- name: Bump values.yaml
run: |
./hack/replace_serverless_chart_images.sh all .
env:
IMG_DIRECTORY: "prod"
IMG_VERSION: ${{ github.event.inputs.name }}
PROJECT_ROOT: "."

- name: Bump sec-scanners-config.yaml based on values.yaml
run: ./.github/scripts/upgrade-sec-scanners-config.sh
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/images-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
paths:
- sec-scanners-config.yaml
- config/serverless/values.yaml
- config/docker-registry/values.yaml

jobs:
# check if developer doesn't change `main` images in the values.yaml and sec-scanners-config.yaml files
Expand All @@ -24,7 +24,7 @@ jobs:
echo SSC_MAIN_IMAGES=$(yq '.protecode[] | select(contains(":main")) | sub(":.*", "")' sec-scanners-config.yaml) >> $GITHUB_ENV

# export values. images with the main tag as github env
echo VALUES_MAIN_IMAGES=$(yq '.global.images[] | select(.version == "main") | .name' config/serverless/values.yaml) >> $GITHUB_ENV
echo VALUES_MAIN_IMAGES=$(yq '.global.images[] | select(.version == "main") | .name' config/docker-registry/values.yaml) >> $GITHUB_ENV

- name: Checkout to context
uses: actions/checkout@v4
Expand All @@ -38,7 +38,7 @@ jobs:

- name: Verify values.yaml images
run: |
PR_NOT_MAIN_IMAGES=$(yq '.global.images[] | select(.version != "main") | .name' config/serverless/values.yaml) \
PR_NOT_MAIN_IMAGES=$(yq '.global.images[] | select(.version != "main") | .name' config/docker-registry/values.yaml) \
.github/scripts/verify-image-changes.sh
env:
MAIN_IMAGES: ${{ env.VALUES_MAIN_IMAGES }}
22 changes: 0 additions & 22 deletions .github/workflows/serverless-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,6 @@ on:
- converted_to_draft

jobs:
#pre-serverless-controller-lint
lint:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-libgit2
- uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: 'components/serverless'

#pre-serverless-controller-unit-test
unit-test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-libgit2
- name: run test
run: make -C components/serverless test

integration-test:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ manifests/serverless/rendered.yaml
serverless.yaml
moduletemplate-latest.yaml
module-config.yaml
dockerregistry-operator.yaml
dockerregistry.yaml

examples/python-text2img/resources/secrets/deepai.env
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are the default owners for the whole content of the `serverless-manager` repository. The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file.
# These are the default owners for the whole content of the `dockerregistry` repository. The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file.
* @m00g3n @pPrecel @dbadura @kwiatekus @cortey @anoipm @MichalKalke

# All files and subdirectories in /docs
Expand Down
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ include ${PROJECT_ROOT}/hack/help.mk
include ${PROJECT_ROOT}/hack/k3d.mk

##@ Installation
.PHONY: install-serverless-main
install-serverless-main: ## Install serverless with operator using default serverless cr
make -C ${OPERATOR_ROOT} deploy-main apply-default-serverless-cr check-serverless-installation
.PHONY: install-dockerregistry-main
install-dockerregistry-main: ## Install dockerregistry with operator using default dockerregistry cr
make -C ${OPERATOR_ROOT} deploy-main apply-default-dockerregistry-cr check-dockerregistry-installation

.PHONY: install-serverless-custom-operator
install-serverless-custom-operator: ## Install serverless with operator from IMG env using default serverless cr
.PHONY: install-dockerregistry-custom-operator
install-dockerregistry-custom-operator: ## Install dockerregistry with operator from IMG env using default dockerregistry cr
$(call check-var,IMG)
make -C ${OPERATOR_ROOT} deploy apply-default-serverless-cr check-serverless-installation
make -C ${OPERATOR_ROOT} deploy apply-default-dockerregistry-cr check-dockerregistry-installation

.PHONY: install-serverless-latest-release
install-serverless-latest-release: ## Install serverless from latest release
.PHONY: install-dockerregistry-latest-release
install-dockerregistry-latest-release: ## Install dockerregistry from latest release
kubectl create namespace kyma-system || true
kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/serverless-operator.yaml
kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/default-serverless-cr.yaml -n kyma-system
make -C ${OPERATOR_ROOT} check-serverless-installation
kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/dockerregistry-operator.yaml
kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/default-dockerregistry-cr.yaml -n kyma-system
make -C ${OPERATOR_ROOT} check-dockerregistry-installation

.PHONY: remove-serverless
remove-serverless: ## Remove serverless-cr and serverless operator
make -C ${OPERATOR_ROOT} remove-serverless undeploy
.PHONY: remove-dockerregistry
remove-dockerregistry: ## Remove dockerregistry-cr and dockerregistry operator
make -C ${OPERATOR_ROOT} remove-dockerregistry undeploy

.PHONY: run
run: create-k3d install-serverless-main ## Create k3d cluster and install serverless from main
run: create-k3d install-dockerregistry-main ## Create k3d cluster and install dockerregistry from main

check-var = $(if $(strip $($1)),,$(error "$1" is not defined))

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/lat
- Create a Serverless instance.

```bash
kubectl apply -f config/samples/default-serverless-cr.yaml
kubectl apply -f config/samples/default-dockerregistry-cr.yaml
```

- Delete a Serverless instance.

```bash
kubectl delete -f config/samples/default-serverless-cr.yaml
kubectl delete -f config/samples/default-dockerregistry-cr.yaml
```

- Use external registry.
Expand Down
2 changes: 1 addition & 1 deletion components/operator/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
!components/operator/internal
!go.sum
!go.mod
!config/serverless
!config/docker-registry
13 changes: 5 additions & 8 deletions components/operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This Dockerfile is used to build serverless-operator image on every pre- and post-submit job
# This Dockerfile is used to build dockerregistry-operator image on every pre- and post-submit job
#


Expand All @@ -23,11 +23,12 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o operator ./components/o


# Replace main images in values.yaml
# Bumping serverless images in the values.yaml - used for building "local" and "dev" images
# Bumping dockerregistry images in the values.yaml - used for building "local" and "dev" images
FROM alpine:3.19.1 as replacer

WORKDIR /workspace

# TODO: remove variable PURPOSE
ARG PURPOSE
ARG IMG_DIRECTORY
ARG IMG_VERSION
Expand All @@ -39,21 +40,17 @@ ENV PROJECT_ROOT="."
RUN apk update && apk add bash yq

COPY components/operator/hack components/operator/hack
COPY config/serverless config/serverless
COPY config/docker-registry config/docker-registry
COPY hack/ hack/

RUN if [[ "dev" = "$PURPOSE" ]] ; then ./hack/replace_serverless_chart_images.sh all ; fi
RUN if [[ "local" = "$PURPOSE" ]] ; then ./hack/replace_serverless_chart_images.sh main-only ; fi
# do nothing (keep unchanged versions) for "release"


# Use distroless as minimal base image to package the operator binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot

WORKDIR /
COPY --chown=65532:65532 --from=builder /workspace/operator .
COPY --chown=65532:65532 --from=replacer /workspace/config/serverless /module-chart
COPY --chown=65532:65532 --from=replacer /workspace/config/docker-registry /module-chart
USER 65532:65532

ENTRYPOINT ["/operator"]
Loading