-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
211 additions
and
6,893 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python:Streamlit", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "streamlit", | ||
"args": [ | ||
"run", | ||
"${file}", | ||
"--server.port", | ||
"8501" | ||
] | ||
}, | ||
{ | ||
"name": "Python: Current File", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal", | ||
"justMyCode": true | ||
} | ||
] | ||
} | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Containerised Development | ||
|
||
Due to the complexity of the PISCA environment this project is designed to be developed and debugged in a container. | ||
|
||
Thus, VSCode is the IDE of choice, as the ability use conatiners for development is integrated and free. It is also possible in a paid-foir version of pycharm. | ||
You will need the Dev Containers extension installed. | ||
|
||
## The container | ||
The develoment container is defined in the `devcontainer.json` file. This file defines the container image to be used, the extensions to be installed and the settings to be used. | ||
|
||
The container image is defined in the `Dockerfile` file. This file defines the base image to be used and the additional packages to be installed. | ||
|
||
## Building the container | ||
- You should not need to build the container, it can pull down from docker automatically | ||
- Should you need to, the instructions for building are at the top of the Dockerfile | ||
|
||
## Using the container | ||
- ctrl-sh-p in vscode and select "Devcontainers: Repoen in container" | ||
|
||
You will see the file system much as before, this time in Workspaces/pisca-box a pseudo linux operating system. | ||
It will feel a bit different to an ordinary dev environment as for example there is no virtual environment, that was all installed in the container. | ||
|
||
If you find a need to add a python library or R library they need to go in the container and then it needs to be rebuilt and redistributed. | ||
|
||
Check it is as you would expect: | ||
```R --version``` will give 4.3.2 | ||
```beast``` will throw java errors - but it is there | ||
|
||
## Installations from the marketplace | ||
You will not have pulled in any of your markletplace extensions so they need re-installing: warning every time the container is rebuilt they need to be re-installed so don't get too comfortable. | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Run the application | ||
|
||
Navigate 1 directory in then run the entry point: | ||
``` | ||
cd pisca-box-run | ||
streamlit run app/home.py | ||
``` | ||
|
||
The application will pop up in [localhost 8501](http://localhost:8501/) | ||
|
||
# Debug the application | ||
https://stackoverflow.com/questions/60172282/how-to-run-debug-a-streamlit-application-from-an-ide | ||
the answer here that starts "If you're a VS Code user," | ||
In summary, create a launch.json on the debugger (left side) in vscode. | ||
Add to it this config below, navigate to the app/home.py page and choose to "run". | ||
``` | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python:Streamlit", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "streamlit", | ||
"args": [ | ||
"run", | ||
"${file}", | ||
"--server.port", | ||
"8501" | ||
] | ||
}, | ||
{ | ||
"name": "Python: Current File", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal", | ||
"justMyCode": true | ||
} | ||
] | ||
} | ||
``` | ||
when on the page you want to run, select python:streannlit and press play. | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Containerised Deployment | ||
|
||
Due to the complexity of the PISCA environment this project is designed to be deployed in a container. | ||
|
||
## The application container | ||
The develoment container has already been explained. | ||
The application container uses the development container as a base to minimise time spent building containers and replicating envirnments. | ||
|
||
The container image is defined in the `pisca-box-vue/Dockerfile` file. | ||
It is fairly light and is mostly only an entry point into the copied code installation. | ||
|
||
## Building the application container | ||
|
||
This is **NOT FROM INSIDE THE DEVCONTAINER** you want to go back to your local folder (ctrl-sh-p "Reopen in local folder"). | ||
|
||
If you need to build and deploy the application container (you are probably in the ICR?) use the docker-compose.yml file. | ||
This has the addition of the listening port, not necessary for manual running of the container, but necessary were it to be deployed on azure. | ||
|
||
You can use docker commands, or you can have the docker extenstion installed. | ||
|
||
On the file pisca-box-vue/docker-compose.yml right click and select "Compose Up" | ||
|
||
This will build the image and run it. | ||
|
||
## Test the image | ||
|
||
You can test the image by running it locally. | ||
```docker run --rm --name pisca-box -p 8002:8501 icrsc/pisca-box``` | ||
[localhost:8002](http://localhost:8002) should show the app. | ||
|
||
## Push the image to docker hub | ||
|
||
You can find the image in the docker dashboard. | ||
|
||
Right-click and select push to upload to docker hub (you need access to be able to upload it to github). | ||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
# Regression Testing | ||
|
||
### In the development container (but not the app) | ||
Run the regression tests from pytests and the lint formatting: | ||
``` | ||
pytest | ||
ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 . | ||
ruff --format=github --target-version=py37 . | ||
``` | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Acceptance testing of a version | ||
|
||
**See below for what RUN CHECKS means** | ||
|
||
1. RUN CHECKS on the proposed application locally as a docker container before pushing to docker hub or github main | ||
2. Upload to docker hub and then RUN CHECKS on that docker image FROM ANOTHER MACHINE | ||
3. Upload to the public webserver and then RUN CHECKS from a non ICR laptop or at least not inside the ICR and not on the VPN | ||
4. RUN CHECKS from a mobile | ||
|
||
|
||
RUN CHECKS means: | ||
- The app is accessible | ||
- The app is responsive | ||
- The app runs | ||
- beauti-box: test you can create a beauti xml file and download it | ||
- pisca-box: test you can upload a beauti xml file and it is displayed | ||
- tree-annotator: test you can annotate the previous trees file and download it | ||
- plot-box: you can produce the plot from the above (or other files) | ||
- The app is performant | ||
- all the above is not too slow | ||
|
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.