Skip to content
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

Resolve Issue #9 (Reorganizing dockerfiles and docker images CI/CD) #26

Merged
merged 40 commits into from
Oct 18, 2023

Conversation

vkt1414
Copy link
Collaborator

@vkt1414 vkt1414 commented Sep 22, 2023

  1. reorganize the docker files to name them more intuitively and include description of the functionality

    • Dockerfiles are now reorganized by their task names instead of task numbers.
    • Old vs New Folders
      • task1 = imagingdatacommons/download_convert
        task2 =imagingdatacommons/inference_totalseg
        task3 =imagingdatacommons/radiomics
        tasks1and2 =imagingdatacommons/download_convert_inference_totalseg
        end_to_end =imagingdatacommons/download_convert_inference_totalseg_radiomics
  2. set up automated docker image build process (probably, using GitHub Actions) and deposit each functionally distinctive image into an intuitively named DockerHub repo, tagged with the GitHub hash as a version

    • for each dockerfile, a github actions script is employed to build dev or latest tags depending on the branch (dev or main),
      whenever the corresponding dockerfile or the weight_download script or the github actions script itself is modified.
    • https://hub.docker.com/?namespace=imagingdatacommons
    • A short description and overview is written for each docker image repository
    • The docker image will have a label layer, containing the maintainer, base image used, githash, and the url to the dockerfile corresponding to the git commit hash
    • The docker base images are now used with sha256 digest instead of the tag directly as the tag may be overwritten.

The last four commits spilled are related to other issues. Will isolate branches going forward.

@fedorov
Copy link
Member

fedorov commented Sep 23, 2023

@vkt1414 nice PR summary!

When you reference the corresponding issue, it's usually done by using hash sign followed by issue number in the commit message - this will establish the connection - such as #9.

@fedorov fedorov linked an issue Sep 23, 2023 that may be closed by this pull request
@vkt1414 vkt1414 changed the title Resolve Issue 9 (Reorganizing dockerfiles and docker images CI/CD) Resolve Issue #9 (Reorganizing dockerfiles and docker images CI/CD) Sep 23, 2023
@vkt1414 vkt1414 closed this Sep 25, 2023
@vkt1414 vkt1414 reopened this Sep 25, 2023
@vkt1414 vkt1414 marked this pull request as ready for review September 25, 2023 14:31
@fedorov fedorov marked this pull request as draft September 27, 2023 15:34
@fedorov fedorov marked this pull request as ready for review September 27, 2023 15:42
Copy link
Member

@fedorov fedorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall comments:

  • How about we rename the steps of the workflow as download, convertInput, inference, pyradiomics? If later we decide to add other segmentation tools, we can rename inference step to be tool-specific, but we can do it later.
  • Can you please update other workflows to have trigger on PR?
  • I think we may also want to have a trigger on commit to the main branch, and push docker images to DockerHub/GHR only on main commits. I am not sure we should push images from the PRs until those are finalized.

id: https://cgc-api.sbgenomics.com/v2/apps/vamsikrishna14/idc/totalsegmentatorend-to-end/1/raw/
sbg:id: vamsikrishna14/idc/totalsegmentatorend-to-end/1
sbg:revision: 1
id: https://cgc-api.sbgenomics.com/v2/apps/vamsikrishna14/idc/totalsegmentatorend-to-end/2/raw/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the meaning of this line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generate this file off of the workflows from SB-CGC unlike WDL files, where we write the code ourselves.

The link is referencing the app in my project.

sbg:image_url:
sbg:appVersion:
- v1.2
sbg:id: vamsikrishna14/idc/downloaddicomandconvert/2
sbg:revision: 2
sbg:id: vamsikrishna14/idc/downloaddicomandconvert/3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another reference to your personal ID - is it needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since an issue was opened just to address references, I created another branch for it, fixed most references already there, and plan to submit a pull request.

for the personal ID, I did not evaluate what part of the cwl file is mandatory and what is not. I will evaluate, clean up and submit the pull request fix referencing #4.

@fedorov
Copy link
Member

fedorov commented Sep 27, 2023

@vkt1414 sounds good - we should describe those points in the documentation under the respective folder of the repo. Will you update the other workflows or should I do it?

@vkt1414
Copy link
Collaborator Author

vkt1414 commented Sep 27, 2023

@vkt1414 sounds good - we should describe those points in the documentation under the respective folder of the repo. Will you update the other workflows or should I do it?

I can add/update the readme.md file with in the cwl files folder, to explain how the CWL file is generated, what we chose to keep and what we stripped.

@fedorov
Copy link
Member

fedorov commented Sep 28, 2023

We can do this separately, no need to hold this PR.

Can you make the other changes I asked - updating workflows as the one I modified, and also pushing the images only when the commit is made to the main branch? Let me know if you need help.

@vkt1414
Copy link
Collaborator Author

vkt1414 commented Sep 28, 2023

We can do this separately, no need to hold this PR.

Can you make the other changes I asked - updating workflows as the one I modified, and also pushing the images only when the commit is made to the main branch? Let me know if you need help.

Sure. I just made changes to github actions files, the same way you edited one yesterday, to rebuild images on main branch only with a pull request.

I also renamed the radiomics to dicom_seg_pyradiomics_sr to describe more closely what we are using the docker image for.. I believe these are all the changes related to dockerfiles.


push-dockerhub:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@fedorov fedorov merged commit 5c18b35 into main Oct 18, 2023
18 checks passed
@vkt1414 vkt1414 mentioned this pull request Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reorganize Dockerfiles and improve image generation process
2 participants