-
Notifications
You must be signed in to change notification settings - Fork 27
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
Added a yml file to build the docker image #74
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this direction. Just a few comments but I think it's really close already.
docker run -it --rm --name TF2.4_IVIM-MRI_CodeCollection \ | ||
-v ${{ github.workspace }}:/usr/src/app \ | ||
-v ${{ github.workspace }}:/usr/app/output \ | ||
tf2.4_ivim-mri_codecollection brain.nii.gz brain.bvec brain.bval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the data are available. We could pull it, but that run would take a while. Maybe we could read a small text file that does just a few fits and takes just a second or two. We really just want to run it to confirm it works, we have other tests to check the actual results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to go about the reading the small text file ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps even easier to simulate something. You can generate signals using from utilities.data_simulation.GenerateData import GenerateData
. It's done in test_ivim_synthetic.py
for example. Then save it to a nifti using the function you wrote, then read the nifti. Maybe just a 10x10x1 or something small and fast. B-values of [0, 50, 100, 200, 500, 1000] with maybe one or two vectors.
Doing well and thanks for coming back to this. I submitted a review for you. |
docker run -it --rm --name TF2.4_IVIM-MRI_CodeCollection \ | ||
-v ${{ github.workspace }}:/usr/src/app \ | ||
-v ${{ github.workspace }}:/usr/app/output \ | ||
tf2.4_ivim-mri_codecollection brain.nii.gz brain.bvec brain.bval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps even easier to simulate something. You can generate signals using from utilities.data_simulation.GenerateData import GenerateData
. It's done in test_ivim_synthetic.py
for example. Then save it to a nifti using the function you wrote, then read the nifti. Maybe just a 10x10x1 or something small and fast. B-values of [0, 50, 100, 200, 500, 1000] with maybe one or two vectors.
|
||
- name: Save Docker image to a tarball | ||
run: | | ||
docker save -o tf2.4_ivim-mri_codecollection.tar tf2.4_ivim-mri_codecollection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These things are large, how about also zipping it.
I'm just saying random but realistic f [0, 1], D [0, 1e-3], D* [0, 1e-1], generate b-value curves from that using the GenerateData that you linked to and the b-values I suggested above. Generate that volume and use that as a test dataset. |
@etpeterson, I think I might need your regarding this part. Thank you. I am able to get it. |
Something roughly like this. I haven't tested it but it has the basics.
|
Did something similay earlier. Apparently the error seems to come from GenerateData due to shape imcompability. |
What's the error specifically? I'm not sure if I've ever tried GenerateData with multiple values at a time, but it doesn't seem like the lines you linked should be causing problems. |
assert D >= 0, 'D must be >= 0' |
Ok, so this assert is correct except that it should be in numpy format, so |
Hey, just checking - are you still working on this? |
@etpeterson, I have resumed working on it, should get back in few minutes. |
… for generating the sample data. Zipped the docker image generated. Make changes to nifit_wrapper to use 4, 4
@etpeterson kindly go through this whenever you are chanced. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. A few more comments.
utilities/data_simulation/np
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some erroneus files, will remove it.
import nibabel as nib | ||
from utilities.data_simulation.GenerateData import GenerateData | ||
|
||
def save_nii(data, filename='ivim_image.nii.gz'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's already a save_nifti_file
in the wrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this file? It looks like it generates an image but I don't see it being used for anything. I was expecting to see the simulated image and associated files generated by this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the code I used for generating the signal which I was using for the docker. I did not make use of it because I already generated the images. I will restructured it to generate the images on the fly thereby making use of it in the build process.
Docker/ivim_simulation.nii.gz
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the associated bval and bvec files are inside the docker folder, so they're getting added to the docker image. We don't want that. Also, shouldn't they be generated on the fly rather than be pre-generated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will generate it on the fly, I thought it makes sense having it constant.
|
||
- name: Run Docker container | ||
run: | | ||
docker run --rm --name TF2.4_IVIM-MRI_CodeCollection \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should confirm that images are actually generated. Maybe not the exact values in the images, but even that the files we expect exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, exactly.
…ation to ensure files are being generated
…nning the image generation script
056deca
to
7b2f0b8
Compare
@etpeterson, kindly take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, really just those few changes and the question about the docker file artifact.
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docker-image | ||
path: tf2.4_ivim-mri_codecollection.tar.gz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing why, but the artifact is empty. I wonder if it's too big? If there's no way to save it perhaps it could be split or maybe we just forget about saving the file for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check this and verify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etpeterson, I think it is there, where are you checking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etpeterson, any suggested solution ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could try a cleaning
- name: Cleanup Docker run: | docker system prune -a --force
You could also try alpine linux base. I think it's smaller but might not work correctly.
If neither of those works then let's build and test but not push.
…e the uploading of the docker to artifact below docker run verification
c8e45e8
to
c6a787d
Compare
@etpeterson, both approach did not work. When I did the cleanup, I was still getting empty files. Also, the alpine base does not support the use of torch which is part of the requirement. So, I am removing the push component |
Ok, seems like that's not possible then. You're still trying to upload the docker image though. Also, please don't rewrite the history like you did with force pushes. It make it really hard to review because I can't see what you had before and what my previous comments relate to. |
My bad, I thought I removed this. I should have verfied in the actions.
I am sorry for this, I was avoiding this also. |
Create a github action for building and running the docker image.
@etpeterson, hello, how are you doing and how have you been ?
Should we make the github action to build the image and also run it or just building. For running, we will need some data, should we download the data during in the github action or add the data as part of the repository ?