Comment on page
Example
# main.py
print("hello world")
FROM python:3.8-slim
COPY main.py /
CMD exec python main.py
docker build . -t hello-world
docker run -it --rm hello-world
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com
aws ecr create-repository --repository-name hello-world
docker tag hello-world <AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/hello-world
docker push <AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/hello-world
# cortex.yaml
- name: hello-world
kind: TaskAPI
pod:
containers:
- name: api
image: <AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/hello-world
command: ["python", "main.py"]
cortex deploy
cortex get hello-world
curl -X POST -H "Content-Type: application/json" -d '{}' http://***.amazonaws.com/hello-world
cortex logs hello-world <JOB_ID>
Last modified 1yr ago