Skip to content

Commit

Permalink
Codespaces (#521)
Browse files Browse the repository at this point in the history
* Create devcontainer.json

* Supported python3.10

Updated PyYAML to 6.0.1 as 5.4.1 do not support py3.10

* Installing medperf via codespaces features

* Update devcontainer.json

* Custom codespaces image

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Update devcontainer.json

* Moved all set up to a container post-start script

* Update devcontainer.json

* update env_start.sh

* moved server start to a post-attach step

* update devcontainer.json

* update devcontainer.json

* Moved server running to a separate script

* Removed commented code

* Used custom codespace image path for future changes

* Added codespaces option to tutorials

* small fix

* add dockerfile placeholder

---------

Co-authored-by: hasan7n <[email protected]>
  • Loading branch information
VukW and hasan7n authored Jan 21, 2024
1 parent c1f809a commit c483929
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 6 deletions.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM mcr.microsoft.com/devcontainers/python:3.10-bookworm
10 changes: 10 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"image": "docker.io/mlcommons/medperf-codespaces:latest",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": false
}
},
"postStartCommand": "bash /workspaces/medperf/tutorials_scripts/codespaces/env_start.sh",
"postAttachCommand": "bash /workspaces/medperf/tutorials_scripts/codespaces/run_server_detached.sh"
}
4 changes: 2 additions & 2 deletions cli/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
typer~=0.6.0
rich~=12.5.0
PyYAML>=5.4,<6
PyYAML==6.0.1
requests>=2.26.0
pydantic==1.10.2
yaspin==2.1.0
Expand All @@ -20,4 +20,4 @@ schema==0.7.5
# setuptools hotfix: https://github.com/mlcommons/medperf/issues/449
setuptools<=66.1.1
email-validator==2.0.0
auth0-python==4.3.0
auth0-python==4.3.0
15 changes: 11 additions & 4 deletions docs/getting_started/shared/before_we_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

#### First steps

To start experimenting with MedPerf through this tutorial, you need to start by following these quick steps:
##### Running in cloud via Github Codespaces

1. **[Create an Account](../signup)**
2. **[Install Medperf](../installation)**
3. **[Set up Medperf](../setup)**
As the most easy way to play with the tutorials you can launch a preinstalled [Codespace](https://github.com/features/codespaces) cloud environment for MedPerf by clicking this link:

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=416800365)

##### Running in local environment

To start experimenting with MedPerf through this tutorial on your local machine, you need to start by following these quick steps:

1. **[Install Medperf](../installation)**
2. **[Set up Medperf](../setup)**

#### Prepare the Local MedPerf Server

Expand Down
13 changes: 13 additions & 0 deletions tutorials_scripts/codespaces/env_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
echo "Preparing local medperf server..."
# we are located at /workspaces/medperf/ where repo is cloned to
pip install -e ./cli
pip install -r server/requirements.txt
pip install -r server/test-requirements.txt
medperf profile activate local

cd server
cp .env.local.local-auth .env
medperf auth login -e [email protected]
echo "Medperf is ready for local usage"
cd ..
3 changes: 3 additions & 0 deletions tutorials_scripts/codespaces/run_server_detached.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
cd /workspaces/medperf/server
bash ./setup-dev-server.sh < /dev/null &>server.log &

0 comments on commit c483929

Please sign in to comment.