<commit_before>TAG ?= master

build:
	bazel build -c opt --define=grpc_no_ares=true //...
run:
	bazel run --define=grpc_no_ares=true //server -- --logtostderr --mysql_service_port=3306 --mysql_service_user=guest --mlmd_db_name=metadb
.PHONY: test
test:
	bazel test -c opt --define=grpc_no_ares=true //...

.PHONY: unittest
unittest:
	bash test/scripts/unittests.sh

update:
	bazel run //:gazelle -- update-repos -from_file=go.mod

# TODO: use bazel to compile the protos instead of local protoc.
mlmd-proto:
	rm -rf /tmp/ml-metadata && \
	git clone --branch $(TAG) https://github.com/google/ml-metadata.git /tmp/ml-metadata && \
	rm -rf ml_metadata/proto && \
	mkdir ml_metadata/proto && \
	cp /tmp/ml-metadata/ml_metadata/proto/*.proto ml_metadata/proto && \
	protoc -I . ml_metadata/proto/*.proto --go_out=plugins=grpc:. && \
	mv ml_metadata/proto/*.go ml_metadata/

metadata-docker-image:
	docker build -t gcr.io/kubeflow-images-public/metadata .

swagger-py-client:
	wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/3.0.0-rc1/swagger-codegen-cli-3.0.0-rc1.jar -O swagger-codegen-cli.jar && \
	java -jar /bin/swagger-codegen-cli.jar generate \
    -i api/service.swagger.json \
    -l python \
    -o swagger_clients/python && \
	rm swagger-codegen-cli.jar<commit_msg>update the swagger generation code (#38)<commit_after>TAG ?= master

build:
	bazel build -c opt --define=grpc_no_ares=true //...
run:
	bazel run --define=grpc_no_ares=true //server -- --logtostderr --mysql_service_port=3306 --mysql_service_user=guest --mlmd_db_name=metadb
.PHONY: test
test:
	bazel test -c opt --define=grpc_no_ares=true //...

.PHONY: unittest
unittest:
	bash test/scripts/unittests.sh

update:
	bazel run //:gazelle -- update-repos -from_file=go.mod

# TODO: use bazel to compile the protos instead of local protoc.
mlmd-proto:
	rm -rf /tmp/ml-metadata && \
	git clone --branch $(TAG) https://github.com/google/ml-metadata.git /tmp/ml-metadata && \
	rm -rf ml_metadata/proto && \
	mkdir ml_metadata/proto && \
	cp /tmp/ml-metadata/ml_metadata/proto/*.proto ml_metadata/proto && \
	protoc -I . ml_metadata/proto/*.proto --go_out=plugins=grpc:. && \
	mv ml_metadata/proto/*.go ml_metadata/

metadata-docker-image:
	docker build -t gcr.io/kubeflow-images-public/metadata .

swagger-py-client:
	mkdir -p /tmp/swagger
	wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.5/swagger-codegen-cli-2.4.5.jar -O /tmp/swagger/swagger-codegen-cli.jar && \
        java -jar /tmp/swagger/swagger-codegen-cli.jar generate \
    -i api/service.swagger.json \
    -l python \
    -o /tmp/swagger && \
        rm -rf python_client/swagger_client && \
        cp -r /tmp/swagger/swagger_client python_client/ && \
        rm -rf /tmp/swagger
{'fraction_non_alphanumeric': 0.15485278080697928, 'fraction_numerical': 0.009451108687749909, 'mean_word_length': 3.1136023916292976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5030524', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1058, 'n_words': 203}