This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# End to end job to build, test, upload to S3 and deploy to AWS Lambda | |
# 1. Builds python package installing dependencies in library we can access for ZIP file | |
# 2. Runs tests with Pytest | |
# 3. Creates ZIP package for Lambda (date-stamped filename) | |
# 4. Uploads to your S3 bucket | |
# 5. Deploys to AWS Lambda function | |
# Runs on update to main branch | |
# Because tests are run, the .pyc files are included in the package (faster Lambda run times?) | |
name: Build, test and deploy to Lambda |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
CWD = os.path.dirname(os.path.abspath(__file__)) | |
#CWD then has the absolute path to this current file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.4" | |
services: | |
backend: | |
build: . | |
ports: | |
- 80:80 | |
env_file: .env | |
restart: unless-stopped |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
traefik: | |
image: "traefik:v2.5" | |
container_name: "traefik" | |
command: | |
#- "--log.level=DEBUG" | |
- "--api.insecure=true" | |
- "--providers.docker=true" | |
- "--providers.docker.exposedbydefault=false" | |
- "--entrypoints.websecure.address=:443" | |
- "--certificatesresolvers.myresolver.acme.tlschallenge=true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend: | |
build: . | |
ports: | |
- 8999:80 | |
env_file: .env | |
restart: unless-stopped | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.routers.backend.rule=Host(`app.example.com`)" | |
- "traefik.http.routers.backend.entrypoints=websecure" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tensorflow_mnist.py | |
# A simple Tensorflow 2 MNIST training script to test installation is working correctly. | |
import tensorflow as tf | |
import tensorflow_datasets as tfds | |
(ds_train, ds_test), ds_info = tfds.load( | |
'mnist', | |
split=['train', 'test'], | |
shuffle_files=True, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# benchmark.py | |
from ai_benchmark import AIBenchmark | |
benchmark = AIBenchmark() | |
results = benchmark.run() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pytorch_mnist.py | |
# Simple MNIST training script on Pytorch to confirm installation is working correctly | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
import torchvision | |
n_epochs = 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
remotedir="[email protected]:/gpu" # TODO Add directory on the remote machine | |
mountdir="/Users/bob/gpu" # TODO Add local directory | |
echo "Mounting (${mountdir})..." | |
#Unmount if it's already mounted | |
if mount | grep "on $mountdir" > /dev/null; then | |
umount ${mountdir} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ssh -L 8888:localhost:8888 -L 6006:localhost:6006 [email protected] |