Package: dartiq
Dockerized ARTIQThis repository provides tools to operate with ARTIQ in dockerized environment.
It makes work with ARTIQ independent from external binary repositories.What you get with the image is a full ARTIQ installation that can be
instantiated and used as a Docker container.dartiqscript acts as an
interface between you and Docker and makes use of dockerized ARTIQ
user-friendly.InstallingDARTIQ scirpt is available on PyPI:python3-mpipinstalldartiqRunning an ARTIQ-enabled shellFor example, to get a shell with ARTIQ installed just typedartiq shell.
This will drop you in the shell with your current working directory mounted as/workspacedirectory in the container. It can be overriden using--workspaceoption.Running single commandYou can run a single command in Docker container by usingrunoption,
e.g.dartiq run "artiq_run ./experiment.py". Please note that your command
must be taken into quotes!By default, inside the container, you'll act as user ofuidandgidof your
own. It should prevent you from having permission problems. If you need to use
differentuidandgid, use--user-groupoption.CAUTION:To be able to access USB devices inside the container,/dev/bus/usbis mounted and container is run inprivilegedmode
(You were warned!). This can be disabled by adding--without-usboption.Xilinx Vivado supportTo be able to build ARTIQ firmware for Xilinx FPGAs, you'll need to have Xilinx
Vivado suite available inside the container.
If you source Xilinx Vivadosettings64.sh(you need to have Vivado installed
on your host system) prior to runningdartiq, a path under which Vivado is
installed will be mounted in the container and your Vivado installation will be
ready to use.If you need provide license information to the Xilinx Vivado, you can pass an
appropriate information using either--copy-env-var XILINXD_LICENSE_FILEoption, which copies given variable to container environment, or by adding new
variable with--add-env-var XILINXD_LICENSE_FILE=<...>.External Python modulesIt may happen that you want to add some Python module to be used inside the
container. Notably, a slightly modified version of ARTIQ, MiSoC or Migen may be
of your interest. You can do it with--add-module <MODULE PATH>option.
This will mount your module in/modulesdirectory and add appropriate entry
in thePYTHONPATH.CAUTION:If you want to use ARTIQ as additional module, it is advised to use
commit used to build DARTIQ image as a base commit to avoid dependency problems.
You can always check ARTIQ commit used to build an image withdartiq versioncommand.Mounting files to containerIf, during run time, you need files or directories that are not beneath current
working directory (i.e. are not in your workspace), you can mount them using-fcommand line option. This will mount selected file/directory under/mountpointsinside the container. Additionally, in the container environment,
a variable will be created named after file/directory basename with dots
replaced with underscores and converted to uppercase. This variable will hold
path to the mounted directory.Option syntax is-f <path to file/directory>[:alias]. Alias is optional and
can be used to mount file/directory under different name. For example-f /home/john/foo:bar.awill mount/home/john/foounder/mountpoints/bar.aand addBAR_A=/mountpoints/bar.ato the execution environment.Obtaining information on ARTIQ versiondartiq versioncan be used to get information on the source commit of DARTIQ
image, included ARTIQ commit and revision of Nix Scripts repository used to
build DARTIQ image.Configuration fileIt is possible to pass script configuration as a JSON file. This may be useful
for defining per-project configurations. By defaultdartiq.jsonfile from the
current directory is used. Configuration file path can be overridden using--configargument.Example configuration file contents with all supported parameters:{"image":"technosystem/dartiq:latest","worksapce":"./","xilinx_vivado_path":null,"xilinx_ise_path":null,"with_usb":true,"docker_options":["--privileged"],"python_modules":["modules/artiq","modules/misoc"],"verbose":false,"copy_env_var":["XILINXD_LICENSE_FILE"],"add_env_var":["FOO=BAR"]}Command-line options override configuration file settings or expand them in case
of additional modules, Docker options and environment variables.Device access from withing the containerBy default container starts with USB support and inprivilegedmode. However,
because in the container you act as a normal user (of your currentuid),
appropriateudevrules are required. The fact that you can access devices
withoutsudoon your host system may not be enough for them to be accessible
for the user in the container as that user is not a member of additional groups
that may be available on your host (e.g.plugdev).To give unconstrained access to devices most commonly used with ARTIQ you can
create file/etc/udev/rules.d/99-dartiq.rules(tested on Ubuntu 18.04 host)
with the following contents:# FT232H Single HS USB-UART FIFO IC, aka Digilent HS-3 JTAG
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", MODE="666"

# FT4232H Quad HS USB-UART/FIFO IC, found on Kasli, Sayma, Metlino
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="666"Examples of Use# Display help messagedartiq--help# Run experimentdartiqrun"artiq_run ./experiment.py"# Display artiq_run help messagedartiqrun"artiq_run --help"# Running shell with ARTIQ from specified directorydartiqshell-m~/repos/artiq/artiq