[[Include(WikiToC)]] == Node Images === Summary The imaging process is executed by the commands 'omf load' and 'omf save' These provision a full disk image onto a set of nodes, and should work for any ext2/3/4 filesystem. After saving an image from one node, and loading it onto another, it will appear to the user that a copy of the hard disk has been made. Specifically, this is a block based copy, not a file based one. The baseline image is a recommended starting point, as this provisioning tool does not currently work with standard .iso or similar files, instead using a custom compressed .ndz format. === Security and Access ==== Images Images you save are saved to the directory "/export/omf-images-5.4/" They have permissions to be writable by your user, and readable by your group, and all logged in users. You can customize this via the chmod and chown commands. For example, you may want to restrict the ability to load your images to only members of a specific group. ==== SSH ** WARNING: For nodes that may be accessible externally, [mobile nodes, tunnels to an external subnet, etc] it is YOUR responsibility to set credentials to prevent remote login.** This can be done via the passwd command, and / or editing the file /etc/ssh/sshd_config The default baseline image allows passwordless based access as the user native, from RFC1918 private ip space: 10/8 172.16/12 192.168/16 Root login is disabled Passwordless Sudo is enabled for the user native. You should set up your own accounts, or customize your image's ssh config if you need something different. === List of pre-defined images {{{#!rst +--------------------------+-----------------------------+----------+---------+--------+ | Image Name | Description | username | Updated | Status | +--------------------------+-----------------------------+----------+---------+--------+ | bare-1804.ndz | ubuntu18.04 + basic config | root | n/a | ready | +--------------------------+-----------------------------+----------+---------+--------+ | baseline-1804.ndz | bare + omf tools | root | n/a | | +--------------------------+-----------------------------+----------+---------+--------+ | baseline_uhd315-1804.ndz | baseline + uhd 3.15 | root | n/a | ready | +--------------------------+-----------------------------+----------+---------+--------+ | baseline_gr38-1804.ndz | baseline_uhd + gnuradio 3.8 | root | n/a | ready | +--------------------------+-----------------------------+----------+---------+--------+ | baseline_cuda-1804.ndz | baseline + cuda + drivers | root | n/a | | +--------------------------+-----------------------------+----------+---------+--------+ | baseline_tensorflow.ndz | baseline_cuda + tensorflow | root | n/a | | +--------------------------+-----------------------------+----------+---------+--------+ | baseline_pytorch.ndz | baseline_cuda + pytorch | root | n/a | | +--------------------------+-----------------------------+----------+---------+--------+ }}} ==== Bare This is a customized image, build off of Ubuntu Server 18.04 [[CollapsibleStart]] {{{#!dockerfile FROM scratch as bare ADD src/18.04-server-cloudimg-amd64-root.tar.xz / #docker optimizations for apt RUN set -xe \ \ # https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L85-L105 && echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > /etc/apt/apt.conf.d/docker-clean \ && echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' >> /etc/apt/apt.conf.d/docker-clean \ && echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> /etc/apt/apt.conf.d/docker-clean \ \ # https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L109-L115 && echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/docker-no-languages \ \ # https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L118-L130 && echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/docker-gzip-indexes \ \ # https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L134-L151 && echo 'Apt::AutoRemove::SuggestsImportant "false";' > /etc/apt/apt.conf.d/docker-autoremove-suggests ARG KERNEL_TYPE="generic" ARG COMMON_PKGS="vim emacs git dnsutils" ENV DEBIAN_FRONTEND=noninteractive \ TERM=linux #set up apt sources COPY files/apt/ /etc/apt/ RUN wget -qO - https://www.mellanox.com/downloads/ofed/RPM-GPG-KEY-Mellanox | apt-key add - #install bootloader and kernel, common packages RUN apt update && apt install --no-install-recommends -fy \ linux-image-${KERNEL_TYPE} \ linux-headers-${KERNEL_TYPE} \ grub-pc \ software-properties-common \ build-essential \ ssh \ ${COMMON_PKGS} #disable auto updates RUN apt -fy purge unattended-upgrades #create users with "blank" passwords. WARNING, very insecure!!! RUN echo "root:root" | chpasswd && \ sed -i 's/^\(root:\)[^:]*\(:.*\)$/\1\2/' /etc/shadow && \ cp -r /etc/skel/. /root/ COPY files/fstab /etc/fstab COPY files/grub /etc/default/grub RUN rm /etc/default/grub.d/* COPY files/00-netplan.yaml /etc/netplan/00-netplan.yaml COPY files/ssh/server/* /etc/ssh/ COPY files/ssh/client/* /root/.ssh/ #fix ssh key permissions RUN chmod 400 /etc/ssh/ssh_host_*_key && chmod 444 /etc/ssh/ssh_host_*_key.pub #16.04 and prior use ifupdown #COPY dhcp/hostname-ifupdown /etc/dhcp/dhclient-exit-hooks.d/hostname #18.04 uses netplan and networkd-dispatcher COPY files/dhcp/hostname-networkd /etc/networkd-dispatcher/routable.d/20-hostname.sh RUN chmod +x /etc/networkd-dispatcher/routable.d/20-hostname.sh #clean up build RUN rm -f /etc/apt/apt.conf.d/01proxy && \ rm -rf /var/lib/apt/lists/* && \ apt clean && \ apt autoclean #commands are rune when container is started #workaround for "locked" files in docker-build #this may delay image saving COPY files/late_commands.sh /root/late_commands.sh ENTRYPOINT ["/root/late_commands.sh"] CMD ["/bin/bash"] }}} [[CollapsibleEnd]] ==== Baseline The baseline image is a very bare install of Ubuntu 18.04 Bionic You should customize it to you needs, and use that as a base for your experiments. After saving an image, it will NOT track changes to the baseline, it is a copy, not a delta. You may periodically want to re-create your experimental images when a new baseline has been relased, to support new hardware, or newer drivers, etc. ==== Baseline UHD Baseline UHD has UHD images downloaded, and uhd3.14 installed from source. ==== Baseline GR ==== Baseline CUDA The cuda baseline image is meant to be run on the cosmos server machines containing V100 GPUs. It is built with Nvidia drivers for the GPUs and CUDA libraries for general purpose GPU programming. The baseline image is built with driver version 410.104 with cuda 10.0 libraries. If you would like to create a cuda image using different versions of either the drivers or cuda, you can do so by starting with the baseline_1804 image. 1. Select the driver version you need from [https://www.nvidia.com/Download/Find.aspx?lang=en-us the Nvidia Driver Downloads Page]. Be sure to specify the product type as "Tesla" and the product series as "V-Series". Click download and then on the following page, right click on the "agree & download" and copy the link address. On the node, use wget or curl to download the link you copied. * "dpkg -i nvidia-diag-driver-local-repo-ubuntu1804-410.104_1.0-1_amd64.deb" note: you may be asked to add a gpg key during the installation process. Use the command that is given. * "apt-get update" * "apt-get install cuda-drivers" * log out of the node and use omf tell to turn it off and on again. When you log back into the node, running lsmod should demonstrate that the nvidia drivers have been loaded. 2. Select the version of cuda you need from [https://developer.nvidia.com/cuda-toolkit-archive the cuda toolkit archive], then choose your operating system (Linux), architecture (x86_64), distribution (Ubuntu), and version (18.04). Choose "deb(local)" as the installer type. Again, copy the download link and use wget to download it onto the node. You can then follow the installation instructions on the download page. 3. To verify your cuda installation, you can build and run some of the cuda samples. They'll be found in /usr/local/cuda/samples. 4. You will also have to add the directory of cuda binaries to the path. Edit the .profile file and add 'PATH="PATH:/usr/local/cuda/bin"' ==== Baseline Tensorflow ==== Baseline Pytorch === Advanced ==== Building a baseline image 1. Use pxe or usb to install ubuntu netinstall iso 1. Start it up, run update and dist-upgrade 1. set netplan.io to dhcp on all physical ethernet interfaces 1. add dhclient-exit-hook/hostname to dynamically set hostname based on DHCP 1. add prepare.sh script to generalize prior to saving images