Run Scripts: Getting Started
bueno run
coordinates container image activation and the execution of bueno
run scripts—a programmatic description of the steps required to conduct a
benchmarking activity. Currently, there are two image activators implemented in
bueno: charliecloud
and none
. The former uses Charliecloud to activate a given container image and
the latter is a pass-through to the host.
Hello World!
Below is the source code of the simplest bueno run script named hello.py
.
Please note that the source code contains helpful comments that aid in
understanding fundamental bueno run script structure.
# bueno provides a collection of public modules containing helpful utilities. At
# a minimum, the experiment module contained within the bueno.public package
# must be imported by a bueno run script.
from bueno.public import experiment
from bueno.public import logger
# main() is the entry point for all bueno run scripts. argv is a list of
# argument strings passed to this program by the bueno run service.
def main(argv):
# Set the experiment's name. This particular experiment is named
# hello-world.
experiment.name('hello-world')
# The logger emits strings to the console. Additionally, the output
# produced by logging actions is recorded and stored in experiment data
# written (by default) after experiment termination.
logger.log('hello world')
In the following example, we execute hello.py
using the none
(i.e.,
host pass-through) image activator. To execute the script, run the following
command (assumes hello.py
is stored in your current working directory):
$ bueno run -a none -p hello.py
This program invocation should produce console output similar to the following:
#
# Starting run at 2020-04-24 08:42:05
#
# $ /home/samuel/.local/bin/bueno run -a none -p hello.py
#
# Looking for container metadata...
#
# Note: the none activator has no metadata
# Begin run Configuration (YAML)
Configuration:
image: null
image_activator: none
output_path: /home/samuel/devel/bueno/examples/hello
Host:
hostname: localhost.localdomain
kernel: Linux
kernel_release: 5.3.7-200.fc30.x86_64
os_release: Fedora 30 (Workstation Edition)
whoami: samuel
# End run Configuration (YAML)
#
# Begin Program Output (hello.py)
#
hello world
#
# End Program Output
#
# run Time 0:00:00.101665
# run Done 2020-04-24 08:42:05
# run Output Target: /home/samuel/devel/bueno/examples/hello/hello-world/2020-04-24/0
# Writing Data Assets at 2020-04-24 08:42:05
# run Output Written to: /home/samuel/devel/bueno/examples/hello/hello-world/2020-04-24/0
More bueno run Help
Additional run service information is provided by the output of bueno run
--help
.