Skip to content

Commit a6447fc

Browse files
author
Xing Han Lu
authored
Merge pull request #634 from plotly/dev
Update Circle CI and server migration Former-commit-id: 1b2a5a5
2 parents fd8d06c + de6581f commit a6447fc

125 files changed

Lines changed: 318 additions & 291 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 90 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2.0
1+
version: 2.1
22

33
jobs:
44
test_black:
@@ -16,111 +16,114 @@ jobs:
1616
name: run black
1717
command: |
1818
black . --check
19-
deploy_to_playground:
20-
docker:
21-
- image: circleci/python:3.6-stretch
22-
working_directory: ~/dash-sample-apps
23-
steps:
24-
- checkout
25-
- run:
26-
name: Add plotly remote
27-
command: git remote add playground https://dash-playground.plotly.host/GIT/$CIRCLE_BRANCH
28-
- run:
29-
name: Create helper-script
30-
command: printf '#!/bin/bash\necho username=$PLAYGROUND_DEPLOY_USERNAME\necho password=$PLAYGROUND_DEPLOY_PASSWORD' >> /home/circleci/helper-script.sh
31-
- run:
32-
name: Set up git config
33-
command: |
34-
git config --global credential.helper "/bin/bash /home/circleci/helper-script.sh"
35-
git config --global user.email '<>' # Leave email blank
36-
git config --global user.name "Circle MonoRepo Automatic Deployer"
37-
- run:
38-
name: Install curl
39-
command: |
40-
sudo apt update
41-
sudo apt install -y -qq curl
42-
- run:
43-
name: Install dds-client
44-
command: |
45-
curl -sSL -o dds-client.tgz https://github.com/plotly/dds-client/releases/download/v0.3.0/dds-client_0.3.0_linux_x86_64.tgz
46-
mkdir $HOME/bin
47-
tar xzf dds-client.tgz -C $HOME/bin
48-
chmod +x $HOME/bin/dds-client
49-
- run:
50-
name: Deploy
51-
command: |
52-
APPS_MODIFIED=$(git diff origin/master origin/$CIRCLE_BRANCH --dirstat=files,1 apps/ | awk '{ split($2,a,"/"); if (length(a[2]) != 0) { print a[2]} } ' | sort -u)
53-
if [ -z "$APPS_MODIFIED" ]
54-
then
55-
echo "No app change detected. Skipping the deploy.."
56-
exit 0
57-
fi
5819
59-
for APP in $APPS_MODIFIED
60-
do
61-
CREATE_APP=true DASH_ENTERPRISE_URL="$DASH_PLAYGROUND_ENTERPRISE_URL" DASH_ENTERPRISE_API_KEY="$DASH_PLAYGROUND_ENTERPRISE_API_KEY" PATH="$HOME/bin:$PATH" ./deploy "$APP"
62-
done
63-
deploy_to_gallery:
20+
deploy:
6421
docker:
65-
- image: circleci/python:3.6-stretch
22+
- image: cimg/base:stable-20.04
6623
working_directory: ~/dash-sample-apps
24+
parameters:
25+
only_changed_apps:
26+
type: boolean
6727
steps:
6828
- checkout
69-
- run:
70-
name: Add plotly remote
71-
command: git remote add gallery https://dash-playground.plotly.host/GIT/$CIRCLE_BRANCH
72-
- run:
73-
name: Create helper-script
74-
command: printf '#!/bin/bash\necho username=$GALLERY_DEPLOY_USERNAME\necho password=$GALLERY_DEPLOY_PASSWORD' >> /home/circleci/helper-script.sh
75-
- run:
76-
name: Set up git config
77-
command: |
78-
git config --global credential.helper "/bin/bash /home/circleci/helper-script.sh"
79-
git config --global user.email '<>' # Leave email blank
80-
git config --global user.name "Circle MonoRepo Automatic Deployer"
81-
- run:
82-
name: Install curl
83-
command: |
84-
sudo apt update
85-
sudo apt install -y -qq curl
86-
- run:
87-
name: Install dds-client
88-
command: |
89-
curl -sSL -o dds-client.tgz https://github.com/plotly/dds-client/releases/download/v0.3.0/dds-client_0.3.0_linux_x86_64.tgz
90-
mkdir $HOME/bin
91-
tar xzf dds-client.tgz -C $HOME/bin
92-
chmod +x $HOME/bin/dds-client
93-
- run:
94-
name: Deploy
95-
command: |
96-
APPS_MODIFIED=$(ls apps | grep dash- | sort -u)
97-
if [ -z "$APPS_MODIFIED" ]
98-
then
99-
echo "No app change detected. Skipping the deploy.."
100-
exit 0
101-
fi
29+
- dash_git_setup
30+
- install_dds_client
31+
- dash_deploy:
32+
only_changed_apps: << parameters.only_changed_apps >>
10233

103-
for APP in $APPS_MODIFIED
104-
do
105-
CREATE_APP=true DASH_ENTERPRISE_URL="$DASH_GALLERY_ENTERPRISE_URL" DASH_ENTERPRISE_API_KEY="$DASH_GALLERY_ENTERPRISE_API_KEY" PATH="$HOME/bin:$PATH" ./deploy "$APP"
106-
done
10734

10835
workflows:
10936
version: 2
11037
test-and-deploy:
11138
jobs:
11239
- test_black
113-
- deploy_to_playground:
40+
41+
#
42+
#
43+
# Feature branch deploys
44+
- deploy:
45+
name: Deploy to dash-playground
46+
context: dash-playground-credentials
11447
requires:
11548
- test_black
11649
filters:
11750
branches:
11851
ignore:
119-
- master
120-
- deploy_to_gallery:
52+
- main
53+
only_changed_apps: true
54+
55+
- deploy:
56+
name: Deploy to dash-playground-k8s
57+
context: dash-playground-k8s-credentials
58+
requires:
59+
- test_black
60+
filters:
61+
branches:
62+
ignore:
63+
- main
64+
only_changed_apps: true
65+
66+
#
67+
#
68+
# main branch deploys
69+
- deploy:
70+
name: Deploy to dash-gallery
71+
context: dash-gallery-credentials
12172
requires:
12273
- test_black
12374
filters:
12475
branches:
12576
only:
126-
- master
77+
- main
78+
only_changed_apps: false
79+
80+
commands:
81+
dash_git_setup:
82+
steps:
83+
- run:
84+
name: Create helper-script
85+
command: printf '#!/bin/bash\necho username=$DASH_ENTERPRISE_USERNAME\necho password=$DASH_ENTERPRISE_PASSWORD' >> /home/circleci/helper-script.sh
86+
- run:
87+
name: Set up git config
88+
command: |
89+
git config --global credential.helper "/bin/bash /home/circleci/helper-script.sh"
90+
git config --global user.email '<>' # Leave email blank
91+
git config --global user.name "Circle MonoRepo Automatic Deployer"
92+
git config --global protocol.version 0
93+
94+
install_dds_client:
95+
steps:
96+
- run:
97+
name: Install dds-client
98+
command: |
99+
curl -sSL -o dds-client.tgz https://github.com/plotly/dds-client/releases/download/v0.3.0/dds-client_0.3.0_linux_x86_64.tgz
100+
mkdir $HOME/bin
101+
tar xzf dds-client.tgz -C $HOME/bin
102+
chmod +x $HOME/bin/dds-client
103+
104+
dash_deploy:
105+
parameters:
106+
only_changed_apps:
107+
type: boolean
108+
steps:
109+
- run:
110+
name: Deploy
111+
environment:
112+
CREATE_APP: "true"
113+
CREATE_DBS: "false"
114+
command: |
115+
APPS_MODIFIED=$(ls apps | sort -u)
116+
<<# parameters.only_changed_apps >>
117+
APPS_MODIFIED=$(git diff origin/main origin/$CIRCLE_BRANCH --dirstat=files,1 apps/ | awk '{ split($2,a,"/"); if (length(a[2]) != 0) { print a[2]} } ' | sort -u)
118+
<</ parameters.only_changed_apps >>
119+
120+
if [ -z "$APPS_MODIFIED" ]
121+
then
122+
echo "No app change detected. Skipping the deploy.."
123+
exit 0
124+
fi
125+
126+
for APP in $APPS_MODIFIED
127+
do
128+
PATH="$HOME/bin:$PATH" ./deploy "$APP"
129+
done

.deployignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ dash-chatbot
66
dash-translate
77
dash-image-enhancing
88
dash-mapd-demo
9-
dash-datashader
10-
vtk-dicom
11-
dash-fashion-mnist-explorer
12-
dash-object-detection
139
dash-lastodash
10+
dash-pileup-demo
11+
dash-gpt3-chatbot
12+
dash-fashion-mnist-explorer

apps/cytoscape-editor/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ You can now run the app:
2424
python app.py
2525
```
2626

27-
and visit http://127.0.0.1:8050/.
27+
and visit http://127.0.0.1:8050/.

apps/dash-3d-image-partitioning/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ The data used in this demo app have been taken from the [MICCAI Brain Tumor Segm
3737

3838
[2] S. Bakas, H. Akbari, A. Sotiras, M. Bilello, M. Rozycki, J.S. Kirby, et al., "Advancing The Cancer Genome Atlas glioma MRI collections with expert segmentation labels and radiomic features", Nature Scientific Data, 4:170117 (2017) DOI: 10.1038/sdata.2017.117
3939

40-
[3] S. Bakas, M. Reyes, A. Jakab, S. Bauer, M. Rempfler, A. Crimi, et al., "Identifying the Best Machine Learning Algorithms for Brain Tumor Segmentation, Progression Assessment, and Overall Survival Prediction in the BRATS Challenge", arXiv preprint arXiv:1811.02629 (2018)
40+
[3] S. Bakas, M. Reyes, A. Jakab, S. Bauer, M. Rempfler, A. Crimi, et al., "Identifying the Best Machine Learning Algorithms for Brain Tumor Segmentation, Progression Assessment, and Overall Survival Prediction in the BRATS Challenge", arXiv preprint arXiv:1811.02629 (2018)

apps/dash-aerosandbox/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ An interactive demo of AeroSandbox, powered by Dash! Work in progress.
99
2. Run `app.py` to launch a local Dash server to host the Dash app. A link will appear in your console; click this to use the Dash app.
1010

1111
## Illustration
12-
![Screenshot of Demo](assets/screenshot.png)
12+
![Screenshot of Demo](assets/screenshot.png)

apps/dash-airfoil-design/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ By Peter Sharpe
44

55
Tools for airfoil analysis in your browser.
66

7-
This repository contains the code for the Dash web app itself. All aerodynamics math is contained in [AeroSandbox](https://github.com/peterdsharpe/AeroSandbox); specifically, [here](https://github.com/peterdsharpe/AeroSandbox/blob/master/aerosandbox/aerodynamics/aero_2D/airfoil_inviscid.py).
7+
This repository contains the code for the Dash web app itself. All aerodynamics math is contained in [AeroSandbox](https://github.com/peterdsharpe/AeroSandbox); specifically, [here](https://github.com/peterdsharpe/AeroSandbox/blob/master/aerosandbox/aerodynamics/aero_2D/airfoil_inviscid.py).
8+

apps/dash-aix360-heart/Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web: gunicorn app:server --workers 2
1+
web: gunicorn app:server

apps/dash-aix360-heart/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ and visit http://127.0.0.1:8050/.
6464

6565
### Windows virtualenv
6666

67-
If you are on Windows, and you cannot use Windows Subsystem for Linux (WSL)
67+
If you are on Windows, and you cannot use Windows Subsystem for Linux (WSL)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
aix360
2+
dash
3+
dash-bootstrap-components
4+
plotly
5+
scikit-learn
6+
numpy
7+
pandas
8+
gunicorn

0 commit comments

Comments
 (0)