Pedro Machado
05/17/2021, 2:42 AMPedro Machado
05/17/2021, 2:43 AMARG IMAGE_TAG=latest
FROM <my_registry_url>/vscode:${IMAGE_TAG}
# Install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends dos2unix
RUN mkdir /opt/ml
SHELL ["conda", "run", "-n", "standard_ml_20201110_py37", "/bin/bash", "-c"]
RUN pip install prefect==0.14.19 # "PyJWT<2.0.0"
ENTRYPOINT ["conda", "run", "-n", "standard_ml_20201110_py37"]
The flow:
from dotenv import find_dotenv, load_dotenv
from prefect import Flow, task
from prefect.storage import Docker
load_dotenv(find_dotenv())
@task
def gen_data():
return [1, 2, 3, 4]
@task
def print_data(data):
print(data)
docker_storage = Docker(
dockerfile="flows/packaged_docker/Dockerfile",
image_name="prefect-poc",
image_tag="latest",
python_dependencies=["sh"],
ignore_healthchecks=True,
)
with Flow("Packaged-Docker-POC", storage=docker_storage) as flow:
data = gen_data()
print_data(data)
if __name__ == "__main__":
flow.visualize(filename="packaged-docker")
flow.register(project_name="FMINT", labels=["docker"])
The health check error I get:
Step 14/15 : COPY ./tmpujuroceb/healthcheck.py /opt/prefect/healthcheck.py
---> 20ea31f8c64a
Step 15/15 : RUN python /opt/prefect/healthcheck.py '["/opt/prefect/flows/packaged-docker-poc.prefect"]' '(3, 7)'
---> Running in a694633ca6a6
ERROR conda.cli.main_run:execute(33): Subprocess for 'conda run ['/bin/bash', '-c', 'python /opt/prefect/healthcheck.py \'["/opt/prefect/flows/packaged-docker-poc.prefect"]\' \'(3, 7)\'']' command failed. (See above for error)
/opt/conda/envs/standard_ml_20201110_py37/.tmpi23u0y9t: line 3: syntax error near unexpected token `('
/opt/conda/envs/standard_ml_20201110_py37/.tmpi23u0y9t: line 3: `/bin/bash -c 'python /opt/prefect/healthcheck.py '["/opt/prefect/flows/packaged-docker-poc.prefect"]' '(3, 7)'''
Thanks!Zanie
SHELL
in your DockerfileZanie
Pedro Machado
05/18/2021, 4:49 AM