poncho_package_run(1)

πŸ“¦
version 7.15.9 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

✨ poncho_package_run ✨

okay so bestie, welcome to poncho_package_run β€” it's a Cooperative Computing Tools girlie and she's here to run your Python stuff inside a whole isolated Conda environment πŸ’… (the manual page calls her poncho_package_run(1) if you're being formal, which, slay).


🌸 NAME 🌸

poncho_package_run β€” a wrapper script that executes a Python script inside an isolated Conda environment 🫢


πŸŽ€ SYNOPSIS πŸŽ€

poncho_package_run [options] --environment <file> <command and args ...>

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: poncho_package_run is a wrapper script for a Python task, and it runs that task inside the Conda environment you point it at. That's literally the whole plot πŸ’–. You can use it on different machines inside the Work Queue system to unpack and activate a Conda environment, and then run a task inside that isolated environment. main character energy fr fr.

The --environment <file> argument is the name of the Conda environment as a tarball file in which to run the Python task. And yes, bestie, the --environment <file> argument is the name of the Conda environment as a tarball file in which to run the Python task. I said it twice because the manual says it twice and I do not make the rules, I just vibe with them 😭.

command and args (aka the COMMAND) get interpreted as ARGV for a command to be run inside the Conda environment. Periodt.

By default, the conda environment is unpacked into a temporary directory which is removed at the end of execution 🧚. But if you pass --unpack-to <dir>, then the environment gets unpacked to <dir>, and it is not removed at the end of execution. Even better: further (even simultaneous πŸ‘€) executions of python_package_run will not unpack the environment if <dir> is already populated. Instances of python_package_run coordinate via a writing lock πŸ”’. By default, the wait for a writing lock is 300 seconds, but you can change that with the --wait-for-lock <secs> option.

If the argument to --unpack-to doesn't exist, then it gets created as an empty directory. If it is an existing directory but it is not empty, then unpacking is not performed β€” regardless of whether that directory contains a valid conda environment πŸ’€. So like, heads up.


✨ OPTIONS ✨

  • -e, --environment=<file> β€” Conda environment as a tar file. (Required. so don't forget it bestie 🚨)
  • -u, --unpack-to=<dir> β€” Directory to unpack the environment. If not given, a temporary directory is used.
  • -w, --wait-for-lock=<secs> β€” Number of seconds to wait to get a writing lock on <dir>. Default is 300.
  • -d, --debug β€” Print debug messages. πŸ›
  • --help-env-creation β€” Show instructions to create conda environments as tar files. (iykyk)
  • -h, --help β€” Show the help screen.

🌈 EXIT STATUS 🌈

On success, returns 0 ✨. On failure, returns non-zero 😭.


πŸ’œ EXAMPLE πŸ’œ

poncho_package_run --environment example_venv.tar.gz python3 example.py

This will run the command python3 example.py within the Conda environment in example_venv.tar.gz. Note that this command can be performed either locally, on the same machine that analyzed the script and created the environment, or remotely, on a different machine that contains the Conda environment tarball and the example.py script. Obsessed with the flexibility tbh.

poncho_package_run --unpack-to my_persistent_env --environment example_venv.tar.gz python3 example.py

The previous command will run faster the second time it is executed, because the environment is only unpacked once to my_persistent_env πŸ”₯. Ate and left no crumbs.


The Cooperative Computing Tools are Copyright (C) 2022 The University of Notre Dame. This software is distributed under the GNU General Public License. See the file COPYING for details.


k bye bestie, go run your little isolated environments πŸ’– this was CCTools 7.15.9 FINAL energy and you're gonna slay with it. mwah 🫢✨

πŸ“¦ where this page comes from