Skip to content

Commit

Permalink
Simulation scenarios, TLO CLI, interaction with Azure Batch (#249)
Browse files Browse the repository at this point in the history
Co-authored-by: Mosè Giordano <[email protected]>
Co-authored-by: Tim Hallett <[email protected]>
  • Loading branch information
3 people authored Mar 27, 2021
1 parent 03d96f2 commit 08fc13c
Show file tree
Hide file tree
Showing 24 changed files with 1,993 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,7 @@ venv.bak/
# TLO .rst files
docs/reference/tlo*.rst

# TLO configuration
tlo.conf


2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ include README.rst
include .bumpversion.cfg
include .coveragerc
include tox.ini .travis.yml
include tlo.example.conf

exclude .editorconfig
recursive-exclude .ci *
recursive-exclude deploy *
recursive-exclude outputs *
recursive-exclude resources *

Expand Down
1 change: 1 addition & 0 deletions deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/id_ed25519
26 changes: 26 additions & 0 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM python:3.8-slim-buster

# Setup SSH
RUN mkdir /root/.ssh
COPY id_ed25519 /root/.ssh/id_ed25519
COPY known_hosts /root/.ssh/known_hosts
RUN chmod -R 0600 /root/.ssh

# Install Git, Git LFS. How to silence apt-get commands:
# https://peteris.rocks/blog/quiet-and-unattended-installation-with-apt-get/
RUN apt-get update -qq
RUN DEBIAN_FRONTEND=noninteractive apt-get install -qq -y git git-lfs < /dev/null > /dev/null
# Cleanup apt cache
RUN rm -rf /var/lib/apt/lists/*
# Configure git lfs
RUN git lfs install

# Clone the TLOModel repository and move in it
ARG BRANCH_NAME="master"
RUN git clone --branch "${BRANCH_NAME}" [email protected]:UCL/TLOmodel.git /TLOmodel
WORKDIR /TLOmodel
RUN git gc --aggressive

# Install dependencies
RUN pip3 install -r requirements/dev.txt
RUN pip3 install -e .
27 changes: 27 additions & 0 deletions deploy/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

set -e

REGISTRY_NAME="tlomodel"
REGISTRY_URL="${REGISTRY_NAME}.azurecr.io"
IMAGE_NAME="tlo"
IMAGE_TAG="1.0"
IMAGE_FULL_NAME="${IMAGE_NAME}:${IMAGE_TAG}"

# Documentation at
# https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-docker-cli.

# Login to Azure Container Registry
echo -n "Logging into ${REGISTRY_NAME}..."
az acr login --name "${REGISTRY_NAME}"
echo "done"
# Build the image
echo "Building docker image ${IMAGE_FULL_NAME}..."
docker build --tag "${IMAGE_FULL_NAME}" .
# Tag the image
echo -n "Tagging ${REGISTRY_URL}/${IMAGE_FULL_NAME}..."
docker tag "${IMAGE_FULL_NAME}" "${REGISTRY_URL}/${IMAGE_FULL_NAME}"
echo "done"
# Push the image
echo "Pushing ${REGISTRY_URL}/${IMAGE_FULL_NAME}..."
docker push "${REGISTRY_URL}/${IMAGE_FULL_NAME}"
1 change: 1 addition & 0 deletions deploy/id_ed25519.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC+bU4n6EHIFRqTI1617bR9A54WLjawxGow+X7Rvb1M6 [email protected]
1 change: 1 addition & 0 deletions deploy/known_hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
|1|/L/ftN7pdpk7XqhXWGqqXFDK9yQ=|0IcBIB1SvDcSoXcKhpsmvWRkHDw= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
8 changes: 8 additions & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Base requirements file - common packages we use directly

GitPython
click
numpy
pandas
scipy
openpyxl

# To submit jobs to Azure Batch
azure-batch
azure-identity
azure-keyvault
azure-storage-file-share
113 changes: 107 additions & 6 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,125 @@
#
# pip-compile --output-file=base.txt base.in
#
adal==1.2.6
# via msrestazure
azure-batch==10.0.0
# via -r base.in
azure-common==1.1.26
# via
# azure-batch
# azure-keyvault-certificates
# azure-keyvault-keys
# azure-keyvault-secrets
azure-core==1.11.0
# via
# azure-identity
# azure-keyvault-certificates
# azure-keyvault-keys
# azure-keyvault-secrets
# azure-storage-file-share
azure-identity==1.5.0
# via -r base.in
azure-keyvault-certificates==4.2.1
# via azure-keyvault
azure-keyvault-keys==4.3.1
# via azure-keyvault
azure-keyvault-secrets==4.2.0
# via azure-keyvault
azure-keyvault==4.1.0
# via -r base.in
azure-storage-file-share==12.4.1
# via -r base.in
certifi==2020.12.5
# via
# msrest
# requests
cffi==1.14.5
# via cryptography
chardet==4.0.0
# via requests
click==7.1.2
# via -r base.in
cryptography==3.4.6
# via
# adal
# azure-identity
# azure-keyvault-keys
# azure-storage-file-share
# msal
# pyjwt
et-xmlfile==1.0.1
# via openpyxl
gitdb==4.0.5
# via gitpython
gitpython==3.1.13
# via -r base.in
idna==2.10
# via requests
isodate==0.6.0
# via msrest
jdcal==1.4.1
# via openpyxl
numpy==1.19.5
msal-extensions==0.3.0
# via azure-identity
msal==1.9.0
# via
# azure-identity
# msal-extensions
msrest==0.6.21
# via
# azure-batch
# azure-keyvault-certificates
# azure-keyvault-keys
# azure-keyvault-secrets
# azure-storage-file-share
# msrestazure
msrestazure==0.6.4
# via azure-batch
numpy==1.20.1
# via
# -r base.in
# pandas
# scipy
oauthlib==3.1.0
# via requests-oauthlib
openpyxl==3.0.6
# via -r base.in
pandas==1.2.1
pandas==1.2.2
# via -r base.in
portalocker==1.7.1
# via msal-extensions
pycparser==2.20
# via cffi
pyjwt[crypto]==2.0.1
# via
# adal
# msal
python-dateutil==2.8.1
# via
# adal
# pandas
pytz==2021.1
# via pandas
pytz==2020.5
# via pandas
scipy==1.6.0
requests-oauthlib==1.3.0
# via msrest
requests==2.25.1
# via
# adal
# azure-core
# msal
# msrest
# requests-oauthlib
scipy==1.6.1
# via -r base.in
six==1.15.0
# via python-dateutil
# via
# azure-core
# azure-identity
# isodate
# msrestazure
# python-dateutil
smmap==3.0.5
# via gitdb
urllib3==1.26.3
# via requests
Loading

0 comments on commit 08fc13c

Please sign in to comment.