I'm working on using CloudRun to deploy one of my customized containers. The container runs a python module which takes in arguments using argparse.ArgumentParser()
ENTRYPOINT in Dockerfile:
ENTRYPOINT ["python","label_output.py"]
I can run the container preprocessor:0 successfully using the command:
docker run preprocessor:0 --input data/train/ --label_config data/config.xml --stratified_split 0.3
where the flags are the arguments i feed into the python module.
However, when trying to deploy on Cloud Run, I couldn’t figure out how to pass those arguments to the “gcloud run deploy” command.
For example:
gcloud run deploy --image gcr.io/my-project/preprocessor:0 --platform managed --args "--input data/train/" "--label_config data/config.xml" "--stratified_split 0.3"
gives the error:
(gcloud.run.deploy) unrecognized arguments: --stratified_split 0.3
I couldn’t find any good documentations on how to pass multiple arguments in the above format in Cloud Run, and I tried different ways passing the arguments in the cloud console or in the YAML file, but none of them worked.
Would really appreciate some help on this. Thanks in advance!
Hi,
I'm working on using CloudRun to deploy one of my customized containers. The container runs a python module which takes in arguments using
argparse.ArgumentParser()
ENTRYPOINT in Dockerfile:
ENTRYPOINT ["python","label_output.py"]
I can run the container
preprocessor:0
successfully using the command:docker run preprocessor:0 --input data/train/ --label_config data/config.xml --stratified_split 0.3
where the flags are the arguments i feed into the python module.However, when trying to deploy on Cloud Run, I couldn’t figure out how to pass those arguments to the “gcloud run deploy” command.
For example:
gcloud run deploy --image gcr.io/my-project/preprocessor:0 --platform managed --args "--input data/train/" "--label_config data/config.xml" "--stratified_split 0.3"
gives the error:(gcloud.run.deploy) unrecognized arguments: --stratified_split 0.3
I couldn’t find any good documentations on how to pass multiple arguments in the above format in Cloud Run, and I tried different ways passing the arguments in the cloud console or in the YAML file, but none of them worked.
Would really appreciate some help on this. Thanks in advance!