Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IA-3606] Fix failing GHA automation #27

Merged
merged 8 commits into from
Jul 29, 2022
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
id: short-sha
run: echo "::set-output name=sha::$(git rev-parse --short=12 HEAD)"
- name: Auth to GCR
uses: google-github-actions/setup-gcloud@master
uses: google-github-actions/setup-gcloud@v0.3.0
with:
version: '270.0.0'
service_account_email: ${{ secrets.GCR_PUBLISH_EMAIL }}
Expand Down
46 changes: 41 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A swagger-ui page is available at /swagger-ui/ on any running instance. For exis
### Framework
This project uses the [Flask](https://flask.palletsprojects.com/en/1.1.x/) Python web framework.

### Developing
## Developing
Install dependencies

```sh
Expand All @@ -36,15 +36,51 @@ pip install -r requirements-min.txt
export FLASK_DEBUG=1
```

### R dependencies

Install [Pandoc](https://pandoc.org/installing.html)
```sh
brew install pandoc
```

```sh
R
> install.packages(c("rmarkdown", "stringi", "tidyverse", "Seurat", "ggforce"))
```


Write a config file
```sh
cp config.dev.py config.py
```

Ensure hosts file has the following record:
```
127.0.0.1 local.dsde-dev.broadinstitute.org
```

Update main.py to use Broad's wildcard SSL certificates.
These certificates are the same ones used for any of our web applications.
To get these certificates, run the `configure.rb` script by following the instructions under the title [Running Leo Locally](https://broadworkbench.atlassian.net/wiki/spaces/IA/pages/104399223/Callisto+Developer+Handbook#CallistoDeveloperHandbook-RunningLeoLocally)

Once complete, copy `leonardo/config/server.*` to `/etc/ssl/certs`.

Configure flask to look for the SSL Certificates

```py
# main.py
if __name__ == '__main__':
app.run(port=8080, host='0.0.0.0', ssl_context=('/etc/ssl/certs/server.crt', '/etc/ssl/certs/server.key'))
```

Edit config.py to use development authentication.
``` py
SAM_ROOT = 'https://sam.dsde-dev.broadinstitute.org'
```

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you document the url for access calhoun locally somewhere too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

Run a local server
```sh
FLASK_DEBUG=1 python3 main.py
python3 main.py
```

Or, run a local containerized server which is useful for testing R functionality
Expand All @@ -54,9 +90,9 @@ docker kill t1
docker run -e FLASK_DEBUG=1 --rm -itd --name t1 -p 8080:8080 calhoun-test:0
```

Load pages from localhost:
* http://localhost:8080/status
* http://localhost:8080/api/docs/
Access the application locally:
* https://local.dsde-dev.broadinstitute.org:8080/status
* https://local.dsde-dev.broadinstitute.org:8080/api/docs/

Run unit tests locally
```sh
Expand Down
6 changes: 3 additions & 3 deletions requirements-min.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Explicit dependencies

Flask==1.1.2
Flask==2.1.3
Flask-Cors==3.0.10
flask-talisman==0.7.0
flask-swagger-ui==3.36.0
nbconvert==6.0.7
nbconvert>=6.0.7
nbformat==5.1.3
requests==2.25.1
rpy2==3.4.4
beautifulsoup4==4.10.0

# Transitive dependencies appear after this comment block in requirements.txt.
# To update/freeze all transitive dependencies of requirements-min.txt:
# scripts/freeze-deps.sh
# scripts/freeze-deps.sh
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Flask==1.1.2
Flask-Cors==3.0.10
flask-talisman==0.7.0
flask-swagger-ui==3.36.0
nbconvert==6.0.7
nbconvert>=6.0.7
nbformat==5.1.3
requests==2.25.1
rpy2==3.4.4
Expand Down