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

feat(openapi): Model catalog API spec #823

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ pkg/openapi/go.sum
internal/server/openapi/api
internal/server/openapi/api/**
internal/server/openapi/.openapi-generator-ignore
internal/server/openapi/api_model_catalog_service_service.go
internal/server/openapi/api_model_registry_service_service.go
internal/server/openapi/README.md
internal/server/openapi/main.go
internal/server/openapi/error.go
internal/server/openapi/helpers.go
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ RUN yum module -y enable nodejs:18
# install npm and java for openapi-generator-cli
RUN yum install -y nodejs npm java-11 python3

# Copy the go source
COPY ["Makefile", "main.go", ".openapi-generator-ignore", "openapitools.json", "./"]
# Download tools
COPY Makefile .
COPY scripts/install_protoc.sh scripts/
RUN make deps

# Copy rest of the source
COPY ["main.go", ".openapi-generator-ignore", "openapitools.json", "./"]
COPY cmd/ cmd/
COPY api/ api/
COPY internal/ internal/
Expand All @@ -30,9 +33,6 @@ COPY pkg/ pkg/
COPY patches/ patches/
COPY templates/ templates/

# Download tools
RUN make deps

# Build
USER root

Expand Down
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,16 @@ clean/csi:
rm -Rf ./mr-storage-initializer

.PHONY: clean-pkg-openapi
while IFS= read -r file; do rm -f "pkg/openapi/$file"; done < pkg/openapi/.openapi-generator/FILES
clean-pkg-openapi:
while IFS= read -r file; do rm -f "pkg/openapi/$$file"; done < pkg/openapi/.openapi-generator/FILES

.PHONY: clean-internal-server-openapi
clean-internal-server-openapi:
while IFS= read -r file; do rm -f "internal/server/openapi/$$file"; done < internal/server/openapi/.openapi-generator/FILES

.PHONY: clean
clean: clean-pkg-openapi clean/csi
rm -Rf ./model-registry internal/ml_metadata/proto/*.go internal/converter/generated/*.go internal/server/openapi/api_model_registry_service.go
clean: clean-pkg-openapi clean-internal-server-openapi clean/csi
rm -Rf ./model-registry internal/ml_metadata/proto/*.go internal/converter/generated/*.go

.PHONY: clean/odh
clean/odh:
Expand All @@ -144,6 +149,9 @@ bin/protoc-gen-go-grpc:
bin/envtest:
GOBIN=$(PROJECT_BIN) ${GO} install sigs.k8s.io/controller-runtime/tools/[email protected]

bin/goimports:
GOBIN=$(PROJECT_BIN) ${GO} install golang.org/x/tools/cmd/[email protected]

GOLANGCI_LINT ?= ${PROJECT_BIN}/golangci-lint
bin/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(PROJECT_BIN) v1.61.0
Expand Down Expand Up @@ -175,7 +183,7 @@ clean/deps:
rm -Rf bin/*

.PHONY: deps
deps: bin/protoc bin/go-enum bin/protoc-gen-go bin/protoc-gen-go-grpc bin/golangci-lint bin/goverter bin/openapi-generator-cli bin/envtest
deps: bin/protoc bin/go-enum bin/protoc-gen-go bin/protoc-gen-go-grpc bin/golangci-lint bin/goverter bin/openapi-generator-cli bin/envtest bin/goimports

.PHONY: vendor
vendor:
Expand Down
Loading
Loading