Code Monkey home page Code Monkey logo

apptainerexamples's Introduction

Apptainer Examples for Baskerville

Introduction

Here are three Baskerville Apptainer examples - these are:

  • A simple Python "Hello World" example
  • An example which calls nvidia-smi allowing you to see what CUDA is being used on the compute node and other details.
  • A PyTorch example which uses pip to install PyTorch, do some basic maths and check that the GPU is being used

The first of these is based on the Alpine docker image, and the second and third on the Debian Stable-slim docker image.

I've included two slurm scripts for each project, one which builds on a compute node (trying to be a responsible citizen!) and one to run the container on a compute node. Currently in the last two cases the build slurm isn't working as there is a problem accessing /tmp on Baskerville.

There are some extra considerations for working like this

  • make sure you run unset APPTAINER_BIND in every shell you're running in.
  • In the build script, build --force means you don't have to deal with the "Would you like to overwrite this image?" dialog.
  • In the def file, prepending all apt commands with DEBIAN_FRONTEND=noninteractive protects you from lockups due to a command asking for user input
  • In pip commands, add --no-cache-dir to prevent pip complaining about access to /tmp directories.

If you have any issues or suggestions, please get in touch with [email protected]

apptainerexamples's People

Contributors

jamesallsopp avatar

Watchers

Simon Branford avatar Ed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.