Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker support #10

Merged
merged 7 commits into from
Jan 13, 2024
Merged

Add Docker support #10

merged 7 commits into from
Jan 13, 2024

Conversation

Liam-Deacon
Copy link
Owner

@Liam-Deacon Liam-Deacon commented Jan 13, 2024

Description

Adds the ability to build and run docker images for phsh.py without the need to install the phaseshifts package in a python environment.

This option should work for users on Linux, Mac OS X and Windows (via WSL) and allows snapshots via @sha docker image syntax to ensure reproducable environments.

fixes #5

NOTE: This option is also a viable workaround for thread-safety issue raised by issue #6 until actual Fortran code/compiler changes can be made

Example

$ docker build . -tag phaseshifts:dev
$ docker run phaseshifts:dev

usage: phsh.py [-h] [-b <bulk_file>] -i <slab_file> [-t <temp_dir>]
               [-l <lmax>] [-f <format>] [-r <energy> [<energy> ...]] [-g]
               [-S <subdir>] [-v] [-V]

phsh.py - quickly generate phase shifts

      Created by Liam Deacon on 2013-11-15.
      Copyright 2013-2014 Liam Deacon. All rights reserved.

      Licensed under the MIT license (see LICENSE file for details)

      Please send your feedback, including bug notifications
      and fixes, to: [email protected]

    usage:-
    

options:
  -h, --help            show this help message and exit
  -b <bulk_file>, --bulk <bulk_file>
                        path to MTZ bulk or CLEED *.bul input file
  -i <slab_file>, --slab <slab_file>
                        path to MTZ slab or CLEED *.inp input file
  -t <temp_dir>, --tmpdir <temp_dir>
                        temporary directory for intermediate file generation
  -l <lmax>, --lmax <lmax>
                        Maximum angular momentum quantum number [default: 10]
  -f <format>, --format <format>
                        Use specific phase shift format i.e. 'cleed' or
                        'curve' [default: CLEED]
  -r <energy> [<energy> ...], --range <energy> [<energy> ...]
                        Energy range in eV with the format: '<start> <stop>
                        [<step>]'. The <step> value is optional. Valid for
                        relativistic calculations only. [default: (20.0,
                        600.0, 5.0)]
  -g, --generate-only   Exit after generating phaseshifts; do not launch
                        subprocess using PHASESHIFTS_LEED environment
                        variable. [default: False]
  -S <subdir>, --store <subdir>
                        Keep intermediate files in subdir when done
  -v, --verbose         set verbosity level [default: None]
  -V, --version         show program's version number and exit

Notes

In order to access files on the host filesystem, you will need to bind mount the relevant directories, e.g.:

docker run phaseshifts:dev -v /home/username/project/data:/data/

@Liam-Deacon Liam-Deacon added the enhancement New feature or request label Jan 13, 2024
@Liam-Deacon Liam-Deacon self-assigned this Jan 13, 2024
@Liam-Deacon Liam-Deacon merged commit a7ab106 into master Jan 13, 2024
5 checks passed
@Liam-Deacon
Copy link
Owner Author

This will be built via make docker going forwards to hide implementation changes such as #82.

Refer to the documentation for the latest means to run via docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dockerise phaseshifts
1 participant