I need to customize the container that gets deploy...
# dagster-serverless
s
I need to customize the container that gets deployed to dagster cloud a bit. I need it to run
meltano install
after adding the code to the image in the
Dockerfile
. I was thinking I could: 1. Build the standard image using
dagster-cloud serverless build
2. Tag the image created something like
dagsterstandard
3. Create a new Dockerfile that looks like:
Copy code
FROM dagsterstandard
RUN cd meltano && meltano install
4. Tag that custom image with the same tag as the standard image and push that to the dagster serverless registry. Think that will work? Any gotchas?
p
@prha is the expert on this
j
I fixed the exact same problem just 1 hour ago. I made some adjustments to the Dockerfile template in our own fork, which gives you the possibility to run your shell script, if it exists. In this file I install all required dependencies and after that install meltano. But this was all really cumbersome. It would be great to have better support for these custom actions.
p
ok we’re going to clean this up this week and enable support for custom base images
🎉 2
s
So you had to fork the Dockerfile template? Which one specifically?
j
For now I forked the `dagster-cloud-action`image. And then pushed this image as
<http://ghcr.io/|ghcr.io/><our-org>/dagster-cloud-action
. And used this image in the Github action. You can take a look here: https://github.com/quantile-development/dagster-cloud-action But it's all a bit hacky. It might be better to wait for official support 🙃
p
I added support in the
dagster-cloud serverless
CLI to provide a custom base image, as well as support for running a
dagster_cloud_pre_install.sh
/
dagster_cloud_post_install.sh
script inside of the target directory if they exist. I’m in the process of adding support to our GH action as well. You should be able to run:
Copy code
dagster-cloud serverless deploy --base-image my_base_image <target_dir>
Note: this is currently org-scoped but have granted access for your orgs
j
Great, thank you very much!
s
Cool, so we should be able to use any base image? Will the container still run
pip install -r requirements.txt
, or will that be assumed to have already been installed?
p
It will still run
pip install -r requirements.txt
if it exists