-
Notifications
You must be signed in to change notification settings - Fork 0
Docker container to execute the Unity App Generator Script #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Follow up task will be: unity-sds/unity-sps#275 |
Finished item 1 on the above ticket
To get the process.cwl generated by the above commands to work with our Modular DAG example and https://raw.githubusercontent.com/unity-sds/unity-example-application/refs/heads/main/test/stage_in/catalog.json, I had to build this on a Linux Machine The next steps are to find a more secure way to pass the DockerHub password and Dockstore token and also creating the DAG |
In which Git repo do you plan to commit the Dockerfile? unity-app-generator? |
I was working in a branch off of unity-app-generator. I thought that repo made the most sense since the entrypoint.sh is putting together the commands outlined in the unity app gen README |
Hi @grallewellyn : great job with completing step 1) and finishing the Dockerfile and the shell script.
2a) Retrieve those parameters from within the shell script, with a command like: the use those values as needed. The AWS boto library must be installed inside the Docker container that runs the shell script. 2b) Another option is to retrieve the SSM parameters from within the DAG, and pass them as env variables to the KubernetesPodOperator - see example here: https://github.com/unity-sds/unity-sps/blob/develop/airflow/dags/sbg_preprocess_no_cwl.py |
I will try the first option! |
Actually @grallewellyn I might have made a mistake... I thought those parameters would be the same for all runs, in which case it makes sense to store them as system-wide SSM parameters. But instead different users will want to push Docker images to different repositories? If that is the case, could you investigate what are the recommended ways to securely pass credentials from the UI (such that they are not echoed in the logs). |
Would it be the case that different users want to push Docker images to different repositories? I am not very familiar with our user working group but I think that would make sense as a case |
Yes, I think we need to support different users using the same SPS installation to push Docker images to different repos. @mcduffie would you agree? Or would a project always push to the same Docker repo? |
I don't think we need to investigate user supplied Docker registry credentials. This will be part of an automated system to push into the application catalog. The application catalog and Docker registry will in the future use the same credentials. But for now we need to save the Docker registry credentials as a system wide SSM. If a user needs to push somewhere else they will have to use the package generator manually. |
This ticket should be carried on to the next PI to demonstrate the full end-to-end functionality. |
Sorry, this ticket has taken me a while because I have been trying to get my airflow deployment working, after giving up on fixing unity-graceal-1 and graceal-1 projects (when they had both worked at some point then randomly stopped), I created a new graceal-2 project which worked and allowed me to post my DAG |
I completed this ticket. Here are some notes about it: DockerHub and Dockstore credentials are being stored in AWS SSM parameter store. I uploaded for Unity-venue-dev, Unity-venue-test and Unity-venue-ops
I published the Docker image that we are using in the DAG to our jplmdps account: https://hub.docker.com/r/jplmdps/unity-app-gen I tested the generated process.cwl file with a CWL DAG Modular My code for the Dockerfile is here: #31 and my code for the DAG is here: unity-sds/unity-sps#390 Note that the Dockerfile will need to change when we want to deploy and start using v1.1.0 of unity app generator and app pack generator (needs to be deployed on pip when changes to these packages are finished) The logs are not displaying any sensitive data such as DockerHub and Dockerstore tokens We can add "Application Package Generator DAG" as an option for users and close this ticket once my PRs are merged: |
Great work @grallewellyn - we can discuss on Monday. The only question for now is whether we should push the Docker image jplmdps/unity-app-gen to Google Container Registry instead of DockerHub. |
Reopening because bullet 3 was not completed: "3. Modifications to the existing Application Package Generation Lambda to call item 2 instead of Gitlab" |
Closing because "3. Modifications to the existing Application Package Generation Lambda to call item 2 instead of Gitlab" has been descoped. |
Uh oh!
There was an error while loading. Please reload this page.
Create a Docker-in-Docker container capable of running the unity-app-generator software.
Currently application packages are built in two manners:
This ticket aims to replace the latter. The current approach involves a API Gateway end point that calls a Lambda. That Lambda then triggers a process in the MCP self hosted Gitlab instance. The Gitlab actions there run the unity-app-generator to build a package and place it within Dockerhub and Dockstore.
But that approach is opaque to users of the API endpoint because there is no feedback on success or failure. Due to the licensing nature of Gitlab, only 2 people have direct access to the build logs.
Instead we would like to replace the Gitlab portion of this process with one that uses Airflow for the building of packages using unity-app-generator. This will require in this order:
Item 1 will require the ability to pass credentials for push_docker and push_app_registry to the Docker image.
Item 2 will require the ability to either store the credentials in a secret store within Airflow or pass them along from item 3.
Item 3 may or may not pull credentials from the AWS Parameter store.
Since the current way Airflow is exposed allows multiple users to look at jobs, credential obfuscation in logs is an essential element of the task. Why? Because in the future it is conceivable that the Application Package Generation API endpoint could allow users to pass their credentials to direct the storage of Docker images and CWL files.
The two credentials involved are one to a Docker registry and one to an application catalog. In the current configuration the Docker registry is Dockerhub and the application catalog is Dockstore.
The text was updated successfully, but these errors were encountered: