diff --git a/apiserver/DEVELOPMENT.md b/apiserver/DEVELOPMENT.md index 8e0304e51a1..c3b3862aa61 100644 --- a/apiserver/DEVELOPMENT.md +++ b/apiserver/DEVELOPMENT.md @@ -7,7 +7,7 @@ This guide covers the purpose, requirements, and deployment of the Kuberay API S | Software | Version | Link | | :------- | :------: | ------------------------------------------------------------------: | | kubectl | v1.18.3+ | [Download](https://kubernetes.io/docs/tasks/tools/install-kubectl/) | -| Go | v1.17 | [Download](https://golang.org/dl/) | +| Go | v1.19 | [Download](https://golang.org/dl/) | | Docker | 19.03+ | [Download](https://docs.docker.com/install/) | | GNU Make | 3.81+ | | | curl | 7.88+ | | @@ -78,12 +78,12 @@ Access the service at `localhost:8888` for http, and `locahost:8887` for the RPC ```bash #creates an image with the tag kuberay/apiserver:latest -make docker-image +make docker-image ``` #### Start Kubernetes Deployment -Note that you should make your KubeRay API server image available by either pushing it to an image registry, such as DockerHub or Quay, or by loading the image into the Kubernetes cluster. If you are using a Kind cluster for development, you can run `make load-image` to load the newly built API server image into the Kind cluster. The operator image will also be needed to be loaded on your cluster. You can use `make operator-image` to build a fresh image from sources, and, if you are using a Kind cluster for development, you can run `make load-operator-image`. +Note that you should make your KubeRay API server image available by either pushing it to an image registry, such as DockerHub or Quay, or by loading the image into the Kubernetes cluster. If you are using a Kind cluster for development, you can run `make load-image` to load the newly built API server image into the Kind cluster. The operator image will also be needed to be loaded on your cluster. You can use `make operator-image` to build a fresh image from sources, and, if you are using a Kind cluster for development, you can run `make load-operator-image`. ```bash #Optionally, to load the api server image into the local kind cluster created with make cluster @@ -102,7 +102,7 @@ make install #To use the helm charts make undeploy -#To use the configuration +#To use the configuration make uninstall ``` @@ -122,7 +122,7 @@ When developing and testing with kind you might want to execute these targets to ```bash #To create a new API server image and to deploy it on a new cluster -make docker-image cluster load-image deploy +make docker-image cluster load-image deploy #To create a new API server image, operator image and deploy them on a new cluster make docker-image operator-image cluster load-image load-operator-image deploy deploy-operator diff --git a/proto/Dockerfile b/proto/Dockerfile index 5b5382dffd8..0b5fdd8b988 100644 --- a/proto/Dockerfile +++ b/proto/Dockerfile @@ -1,5 +1,5 @@ # Generate client code (go & json) from API protocol buffers -FROM golang:1.19.10 as generator +FROM registry.access.redhat.com/ubi8/go-toolset:1.19.10-10 as generator ENV PROTOC_VERSION 3.17.3 ENV GOLANG_PROTOBUF_VERSION v1.5.2 @@ -11,7 +11,8 @@ ENV GOLANG_GRPC_VERSION v1.1.0 ENV GOBIN=/go/bin # Install protoc. -RUN apt-get update && apt-get install -y jq sed unzip +USER root +RUN wget https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 -O /usr/bin/jq && chmod +x /usr/bin/jq RUN curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip RUN unzip -o protoc.zip -d /usr/ bin/protoc RUN unzip -o protoc.zip -d /usr/ 'include/*' @@ -22,6 +23,8 @@ ENV PROTOCINCLUDE /usr/include/google/protobuf # Install protoc-gen-go && protoc-gen-go-grpc RUN go install github.com/golang/protobuf/protoc-gen-go@$GOLANG_PROTOBUF_VERSION RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@$GOLANG_GRPC_VERSION +# These go binaries are installed under /go/bin +ENV PATH /go/bin:${PATH} # Install protoc-gen-rpc-gateway && protoc-gen-openapiv2. RUN go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@$GRPC_GATEWAY_VERSION @@ -33,3 +36,4 @@ ENV XDG_CACHE_HOME /tmp/.cache RUN chmod -R 775 /usr/bin/ RUN chmod -R 775 /usr/include/google RUN chmod -R 775 /go +USER 65532:65532 diff --git a/proto/Makefile b/proto/Makefile index 8a9c684e7f5..49ebf49d0ce 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -1,8 +1,8 @@ # Makefile to generate api clients from proto. -IMAGE_NAME=kuberay/proto-generator -IMAGE_TAG=$(shell git rev-parse HEAD) -PREBUILT_REMOTE_IMAGE=kuberay/proto-generator:8210e17c28b3b373449f99561f10534e13d35969 +IMAGE_NAME ?= kuberay/proto-generator +IMAGE_TAG ?= $(shell git rev-parse HEAD) +PREBUILT_REMOTE_IMAGE ?= ${IMAGE_NAME}:8210e17c28b3b373449f99561f10534e13d35969 OUTPUT_MODE=import TMP_OUTPUT=/tmp