Short answer
• The line you showed will create a ZIP file, but by itself it does not “download” anything to your laptop— it only writes a ZIP file inside the compute instance’s file system.
• Whether it actually does what you intend depends on (a) where you run it, (b) what you want in the archive, and (c) how you plan to pull the archive down afterward.
─────────────────────────────────────────
What the command you wrote really does
─────────────────────────────────────────
myfolderpath="/home/azureuser/cloudfiles/code/Users/tube_segmentor_training/OneFormer/datasets/hf_furnace_tubes"
zip -r "$myfolderpath.zip" .
myfolderpath=... just defines a shell variable that points to a folder.
zip -r "$myfolderpath.zip" .
• Creates /home/azureuser/cloudfiles/code/Users/tube_segmentor_training/OneFormer/datasets/hf_furnace_tubes.zip.
• Adds everything from the CURRENT directory (.) recursively into that archive.
• If you’re already inside the hf_furnace_tubes directory this is fine (except the zip may keep adding itself if you re-run unless you exclude it).
• If you run it from some higher-level directory you may accidentally zip way more than you intended.
Potential gotchas
• Infinite recursion: If you run the command twice the new .zip file can zip itself unless you exclude *.zip.
• Wrong source directory: Make sure . is what you want.
• Zip not installed: On some base images you may have to sudo apt-get update && sudo apt-get install zip.
─────────────────────────────────────────
Typical pattern that’s a bit safer
─────────────────────────────────────────
# zip only the folder you care about, exclude the zip itself, and stay outside the folder
zip -r "${myfolderpath}.zip" "$myfolderpath" -x "${myfolderpath}.zip"
─────────────────────────────────────────
Ok, but how do I actually “download” it?
─────────────────────────────────────────
-
Notebook / Studio GUI
• After the zip is created, refresh the “Files” pane on the left, right-click (… > Download) or just click the file name to start a download.
-
SCP from your machine
• Find the public ssh of the compute instance or connect through az ml compute ssh.
• Example:
scp azureuser@<public-ip>:/home/azureuser/.../hf_furnace_tubes.zip .
-
Upload as a run/output artifact (Python)
import shutil
from azureml.core import Run
myfolder = "/home/azureuser/.../hf_furnace_tubes"
shutil.make_archive('hf_furnace_tubes', 'zip', myfolder)
Run.get_context().upload_file(name="outputs/hf_furnace_tubes.zip", path_or_stream="hf_furnace_tubes.zip")
Then download from the “Outputs + logs” tab of the run.
-
Copy to a Blob or registered datastore and download from the portal or with azcopy.
─────────────────────────────────────────
Take-away
─────────────────────────────────────────
• Your command will create the archive, not download it.
• Use a more explicit path in the zip command if you only want that folder.
• Use one of the four options above to actually pull the file off the compute instance.
Let me know if you need code snippets for a specific method or if anything’s unclear!