Browse Source

decoupled vms from exercise materials through git repo

Claudio Gomes 4 years ago
parent
commit
be37356098

+ 1 - 3
materials/DockerfileTutorials4

@@ -2,11 +2,9 @@ FROM mechatronics3d/jjmodelica
 
 USER root
 
-# Copy local files to the remote notebooks
+# Create remote notebook folder
 RUN mkdir /opt/notebooks
 
-COPY notebooks/ /opt/notebooks/
-
 WORKDIR /opt/notebooks/
 
 # Port

+ 2 - 0
materials/README.md

@@ -44,6 +44,8 @@ docker run --name jupyterrun -p 8888:8888 -ti tutorials4
    
     ```
     /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip=0.0.0.0 --port=8888 --no-browser --allow-root
+      or
+    jupyter notebook --notebook-dir=/opt/notebooks --ip=0.0.0.0 --port=8888 --no-browser
     ```
     
     If a token is given, copy it so that you can later access the jupyter notebook from your browser. Let `TOKEN` denote the token given.

+ 0 - 7
materials/deploy_tutorial.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-docker build -f DockerfileTutorials123567 -t tutorials123567 .
-docker save tutorials123567 | gzip > tutorials123567.tar.gz
-
-docker build -f DockerfileTutorials4 -t tutorials4 .
-docker save tutorials4 | gzip > tutorials4.tar.gz

+ 0 - 7
materials/generate_exercises.ps1

@@ -1,7 +0,0 @@
-& C:\Anaconda3\python.exe .\generate_exercises.py .\notebooks\1-NewtonsLaws\NewtonsLaws_solution.ipynb
-& C:\Anaconda3\python.exe .\generate_exercises.py .\notebooks\2-StationaryAction\StationaryAction_solution.ipynb
-& C:\Anaconda3\python.exe .\generate_exercises.py .\notebooks\3-BondGraphs\BondGraphs_solution.ipynb
-& C:\Anaconda3\python.exe .\generate_exercises.py .\notebooks\4-Modelica\Modelica_solution.ipynb
-& C:\Anaconda3\python.exe .\generate_exercises.py .\notebooks\5-CBDModeling\CBDModelling_solution.ipynb
-
-pause

+ 0 - 52
materials/generate_exercises.py

@@ -1,52 +0,0 @@
-#!/usr/bin/python
-import os
-import argparse
-import re
-
-START_SOLUTION_PATTERN = r'#>Solution'
-END_SOLUTION_PATTERN = r'#<'
-
-StartSolRec = re.compile(START_SOLUTION_PATTERN, re.M|re.I)
-EndSolRec = re.compile(END_SOLUTION_PATTERN, re.M|re.I)
-
-
-if __name__ == '__main__':
-    parser = argparse.ArgumentParser(description='Exercise generation utility')
-    parser.add_argument('file', help='text file the exercises are.')
-    
-    args = parser.parse_args()
-    
-    f = args.file
-    
-    assert os.path.isfile(f)
-    
-    filename, ext = os.path.splitext(f)
-    
-    of = filename.replace("_solution", "")+'_exercises'+ext
-    
-    print("In file " + f)
-    print("Out file " + of)
-    
-    lines = list()
-    inSol = False
-    with open(f, "r", encoding="utf-8") as ins:
-        for line in ins:
-            lines.append(line)
-    
-    with open(of, "w", encoding="utf-8") as outf:
-        for line in lines:
-            startSol = StartSolRec.search(line)
-            if startSol:
-                assert not inSol
-                inSol = True
-                print("Text to ommit:")
-            
-            if not inSol:
-                outf.write(line)
-            else:
-                print(line)
-            
-            endSol = EndSolRec.search(line)
-            if endSol:
-                assert inSol
-                inSol = False