In order for your code to successfully run on the FCP, you must make sure to comply with the following specification:
Modify Where You Are Reading and Writing From in Your Code
- All inputs should be read from the
/input
folder. Datasets will be zero-indexed within the/input
folder (i.e. Input Dataset 1 -/input/0/
, Input Dataset 2 -/input/1/
, etc.)- For Tabular Data:
/input/0/dataset.csv
. If you would like to work with the data as a Pandas DataFrame you can load the Dataset using the following example:df = pd.read_csv(“/input/0/dataset.csv”)
- For file data (data that has been defined in the Data Schema as type Filename):If there is any file data associated with the Dataset, it will be under the /input/file_data/ directory, structured in the same subdirectory structure as was specified when importing the Dataset. Example:
/input/0/file_data/
. - For DICOM data (data that has been defined in the Data Schema as type DicomStudyUID, DicomSeriesUID, or DicomInstanceUID.): If there is any DICOM data associated with the Dataset, it will be under the /input/dicom_data/ directory, structured in the same subdirectory structure as was specified when importing the Dataset. Example:
/input/0/dicom_data/
- For Tabular Data:
- All output should be written to the
/output
mount.- For Tabular Data:
/output/0/dataset.csv
. To write your data as a Pandas DataFrame you can use the following example:df.to_csv(“/output/0/dataset.csv”, index=False)
- For file data:
/output/0/file_data/
- For DICOM data:
/output/0/dicom_data/
- For Tabular Data:
[If applicable] Modify where you are reading your runtime parameters
Any run parameters that have been specified shall be in a file named /input/run_params.json
Creating the Dockerfile
Create a Dockerfile with the configuration necessary for your code. You may use the example provided in the user-resources github repository as a template and make changes as needed where there are comments beginning with "# !! EDIT THIS:"
Ensure any files that might be downloaded at runtime are pre-downloaded and copied to the container in the Dockerfile
Copy files that might need to be downloaded at runtime as pre-downloaded copy statements within the Dockerfile
Optional recommendations
We recommend that you build and test your container locally. There is a utility script called docker-run.sh in the gc-docker-utils folder to assist with this. It can be used by running:
./docker-run.sh path/to/input path/to/output