creamy-ghost-8929
07/28/2022, 5:35 PMopen), so inside the build file, I defined the docker file:
docker_image(
name="gpu",
dependencies = ["docker:base_docker_gpu", "train/semantic_segmentation"],
instructions = [
"FROM base_docker_gpu",
"COPY train.semantic_segmentation/train.pex /bin",
"COPY train/semantic_segmentation/config /root/",
]
)
But the copy instruction fails (./pants package docker/semantic_segmentation:gpu): COPY failed: file not found in build context or excluded by .dockerignore: stat train/semantic_segmentation/config: file does not exist
I tired to add the config folder as a target with the files target:
files(
name="semantic_segmentation_config",
sources=["config/*/*", "config/*.yaml", "config/*/*.yaml"],
)
So, what would be the right way to add the config/ folder to my docker image using?nutritious-minister-3808
07/28/2022, 5:41 PMhappy-kitchen-89482
07/28/2022, 5:43 PMcreamy-ghost-8929
07/28/2022, 5:43 PMdocker_image(
name="gpu",
dependencies = ["//:clearml", "docker:base_docker_gpu", "train/semantic_segmentation:semantic_segmentation_config"],
instructions = [
"FROM base_docker_gpu",
"COPY train.semantic_segmentation/train.pex /bin",
"COPY train/semantic_segmentation/config /root/",
]
)
The image builds ok, but the /root folder is empty.happy-kitchen-89482
07/28/2022, 5:45 PMtrain/semantic_segmentation/config exists in the context, but apparently it's emptyhappy-kitchen-89482
07/28/2022, 5:46 PMfiles target, I wonder if those sources are correctnutritious-minister-3808
07/28/2022, 5:46 PM```files(
name="semantic_segmentation_config",
sources=["config/*/*", "config/*.yaml", "config/*/*.yaml"],
)```It seems like you may want
config/**/*.yamlhappy-kitchen-89482
07/28/2022, 5:46 PMsources=["config/**/*.yaml"],happy-kitchen-89482
07/28/2022, 5:46 PMcreamy-ghost-8929
07/28/2022, 5:52 PMconfig/**/*.yamlcreamy-ghost-8929
07/28/2022, 6:51 PMconfig folder inside the folder in which the .pex file unpacks?
In this example, it is something like: /root/.pex/user_code/4a911aef70bdab03e901678aa2947f11c11df376/semantic_segmentationhappy-kitchen-89482
07/29/2022, 5:38 AMresource into the pex itselfhappy-kitchen-89482
07/29/2022, 5:39 AMresource target to wrap the files, and have the pex_binary target depend on that, instead of the docker_imagehappy-kitchen-89482
07/29/2022, 5:39 AMcreamy-ghost-8929
07/29/2022, 3:48 PMopen, that holds? Or they will get unpacked with the rest of the .pex?happy-kitchen-89482
07/29/2022, 4:22 PMhappy-kitchen-89482
07/29/2022, 4:23 PMpkg_resources mechanisms, because the files don't actually exist on diskhappy-kitchen-89482
07/29/2022, 4:23 PMcreamy-ghost-8929
07/29/2022, 6:55 PMresources and setting the .pex execution mode to venv.