Skip to content

Commit c1cfec8

Browse files
committed
Merge remote-tracking branch 'upstream/branch-0.5'
2 parents ea30c51 + ff66e18 commit c1cfec8

File tree

10 files changed

+118
-156
lines changed

10 files changed

+118
-156
lines changed

.travis.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,6 @@ jupyter lab build
7878
This application is distributed as two subpackages.
7979

8080
The JupyterLab frontend part is published to [npm](https://www.npmjs.com/package/jupyterlab-nvdashboard),
81-
and the server-side part to [PyPI](https://pypi.org/project/jupyterlab-nvdashboard/).
81+
and the server-side part to both [PyPI](https://pypi.org/project/jupyterlab-nvdashboard/) and [Anaconda](https://anaconda.org/rapidsai/jupyterlab-nvdashboard) ([nightlies](https://anaconda.org/rapidsai-nightly/jupyterlab-nvdashboard)).
8282

83-
Releases for both packages are done with the `jlpm` tool, `git` and Travis CI.
84-
85-
_Note: Package versions are not prefixed with the letter `v`. You will need to disable this._
86-
87-
```console
88-
$ jlpm config set version-tag-prefix ""
89-
```
90-
91-
Making a release
92-
93-
```console
94-
$ jlpm version [--major|--minor|--patch] # updates package.json and creates git commit and tag
95-
$ git push && git push --tags # pushes tags to GitHub which triggers Travis CI to build and deploy
96-
```
83+
Releases for both packages are handled by [gpuCI](https://gpuci.gpuopenanalytics.com/job/rapidsai/job/gpuci/job/jupyterlab-nvdashboard/). Nightly builds are triggered when a push to a versioned branch occurs (i.e. `branch-0.5`). Stable builds are triggered when a push to the `main` branch occurs.

ci/checks/style.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/bin/bash
2-
# Copyright (c) 2019, NVIDIA CORPORATION.
2+
# Copyright (c) 2020, NVIDIA CORPORATION.
33

44
# Ignore errors and set path
55
set +e
6-
PATH=/conda/bin:$PATH
6+
PATH=/opt/conda/bin:$PATH
77

88
# Activate common conda env
9-
source activate gdf
9+
. /opt/conda/etc/profile.d/conda.sh
10+
conda activate rapids
1011

1112
# Run flake8 and get results/return code
1213
FLAKE=`flake8 --exclude=src,style,test`

ci/cpu/build.sh

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
#!/bin/bash
2-
# Copyright (c) 2018, NVIDIA CORPORATION.
2+
# Copyright (c) 2020, NVIDIA CORPORATION.
33
set -e
44

5-
# Logger function for build status output
6-
function logger() {
7-
echo -e "\n>>>> $@\n"
8-
}
9-
105
# Set path and build parallel level
11-
export PATH=/conda/bin:/usr/local/cuda/bin:$PATH
12-
export PARALLEL_LEVEL=4
6+
export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH
7+
export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4}
138

149
# Set home to the job's workspace
15-
export HOME=$WORKSPACE
10+
export HOME="$WORKSPACE"
1611

1712
# Switch to project root; also root of repo checkout
18-
cd $WORKSPACE
13+
cd "$WORKSPACE"
1914

2015
# Get latest tag and number of commits since tag
2116
export GIT_DESCRIBE_TAG=`git describe --abbrev=0 --tags`
@@ -26,21 +21,28 @@ if [[ "$BUILD_MODE" = "branch" && "$SOURCE_BRANCH" = branch-* ]] ; then
2621
export VERSION_SUFFIX=`date +%y%m%d`
2722
fi
2823

24+
# Setup 'gpuci_conda_retry' for build retries (results in 2 total attempts)
25+
export GPUCI_CONDA_RETRY_MAX=1
26+
export GPUCI_CONDA_RETRY_SLEEP=30
27+
2928
################################################################################
3029
# SETUP - Check environment
3130
################################################################################
3231

33-
logger "Get env..."
32+
gpuci_logger "Get env"
3433
env
3534

36-
logger "Activate conda env..."
37-
source activate gdf
35+
gpuci_logger "Activate conda env"
36+
. /opt/conda/etc/profile.d/conda.sh
37+
conda activate rapids
3838

39-
logger "Check versions..."
39+
gpuci_logger "Check versions"
4040
python --version
41-
gcc --version
42-
g++ --version
43-
conda list
41+
$CC --version
42+
$CXX --version
43+
conda info
44+
conda config --show-sources
45+
conda list --show-channel-urls
4446

4547
# FIX Added to deal with Anancoda SSL verification issues during conda builds
4648
conda config --set ssl_verify False
@@ -49,21 +51,22 @@ conda config --set ssl_verify False
4951
# BUILD - Conda, pip, & npm package
5052
################################################################################
5153

52-
logger "Build conda pkg for jupyterlab-nvdashboard..."
53-
conda build conda/recipes/jupyterlab-nvdashboard --python=$PYTHON
54+
gpuci_logger "Build conda pkg for jupyterlab-nvdashboard"
55+
gpuci_conda_retry build conda/recipes/jupyterlab-nvdashboard --python=$PYTHON
5456

55-
logger "Build pip pkg for jupyterlab-nvdashboard..."
57+
gpuci_logger "Build pip pkg for jupyterlab-nvdashboard"
5658
rm -rf dist/
5759
python setup.py sdist bdist_wheel
5860

59-
logger "Build npm pkg for jupyterlab-nvdashboard..."
60-
conda install -y nodejs=10 jupyterlab
61+
gpuci_logger "Build npm pkg for jupyterlab-nvdashboard"
62+
gpuci_conda_retry install -y nodejs=10 jupyterlab
63+
npm i -g npm@latest
6164
jlpm install
6265
jlpm build
6366

6467
################################################################################
6568
# UPLOAD - Packages
6669
################################################################################
6770

68-
logger "Upload packages..."
69-
source ci/cpu/upload-packages.sh
71+
gpuci_logger "Upload packages"
72+
source ci/cpu/upload.sh

ci/cpu/upload-packages.sh

Lines changed: 0 additions & 36 deletions
This file was deleted.

ci/cpu/upload.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
# Copyright (c) 2020, NVIDIA CORPORATION.
3+
4+
set -e
5+
6+
# Setup 'gpuci_retry' for upload retries (results in 4 total attempts)
7+
export GPUCI_RETRY_MAX=3
8+
export GPUCI_RETRY_SLEEP=30
9+
10+
# Set default label options if they are not defined elsewhere
11+
export LABEL_OPTION=${LABEL_OPTION:-"--label main"}
12+
13+
# Skip uploads unless BUILD_MODE == "branch"
14+
if [ ${BUILD_MODE} != "branch" ]; then
15+
echo "Skipping upload"
16+
return 0
17+
fi
18+
19+
# Skip uploads if there is no upload key
20+
if [ -z "$MY_UPLOAD_KEY" ]; then
21+
echo "No upload key"
22+
return 0
23+
fi
24+
25+
if [ -z "$TWINE_PASSWORD" ]; then
26+
echo "TWINE_PASSWORD not set"
27+
return 0
28+
fi
29+
30+
if [ -z "$NPM_TOKEN" ]; then
31+
echo "NPM_TOKEN not set"
32+
return 0
33+
fi
34+
35+
################################################################################
36+
# SETUP - Get conda file output locations
37+
################################################################################
38+
39+
gpuci_logger "Get conda file output locations"
40+
export JUPYTERLAB_NVDASHBOARD_FILE=`conda build conda/recipes/jupyterlab-nvdashboard --output`
41+
42+
################################################################################
43+
# UPLOAD - Conda packages
44+
################################################################################
45+
46+
gpuci_logger "Starting conda uploads"
47+
48+
gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing ${JUPYTERLAB_NVDASHBOARD_FILE}
49+
50+
51+
echo "Upload pypi"
52+
twine upload --skip-existing -u ${TWINE_USERNAME:-rapidsai} dist/*
53+
54+
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
55+
if [[ "$BUILD_MODE" == "branch" && "${SOURCE_BRANCH}" != 'main' ]]; then
56+
echo "Nightly build, publishing to npm with nightly tag"
57+
# Updates package.json version before publishing since previous publications can't be overwritten
58+
npm version --no-git-tag-version $(git describe --tags)
59+
npm publish --tag=nightly
60+
else
61+
npm publish
62+
fi

ci/gpu/build.sh

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
#!/bin/bash
2-
# Copyright (c) 2018, NVIDIA CORPORATION.
2+
# Copyright (c) 2020, NVIDIA CORPORATION.
33
set -e
44
NUMARGS=$#
55
ARGS=$*
66

7-
# Logger function for build status output
8-
function logger() {
9-
echo -e "\n>>>> $@\n"
10-
}
11-
127
# Arg parsing function
138
function hasArg {
149
(( ${NUMARGS} != 0 )) && (echo " ${ARGS} " | grep -q " $1 ")
1510
}
1611

1712
# Set path and build parallel level
18-
export PATH=/conda/bin:/usr/local/cuda/bin:$PATH
19-
export PARALLEL_LEVEL=4
13+
export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH
14+
export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4}
2015
export CUDA_REL=${CUDA_VERSION%.*}
2116

2217
# Set home to the job's workspace
@@ -31,34 +26,36 @@ export MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'`
3126
# SETUP - Check environment
3227
################################################################################
3328

34-
logger "Check environment..."
29+
gpuci_logger "Check environment"
3530
env
3631

37-
logger "Check GPU usage..."
32+
gpuci_logger "Check GPU usage"
3833
nvidia-smi
3934

40-
logger "Activate conda env..."
41-
source activate gdf
35+
gpuci_logger "Activate conda env"
36+
. /opt/conda/etc/profile.d/conda.sh
37+
conda activate rapids
38+
39+
gpuci_logger "Install conda dependencies"
40+
gpuci_conda_retry install -y nodejs=10 jupyterlab
4241

43-
logger "Install conda dependencies"
44-
conda install -y nodejs=10 jupyterlab
4542

4643
################################################################################
4744
# TEST
4845
################################################################################
4946

5047
if hasArg --skip-tests; then
51-
logger "Skipping Tests..."
48+
gpuci_logger "Skipping Tests"
5249
else
53-
logger "Check GPU usage..."
50+
gpuci_logger "Check GPU usage"
5451
nvidia-smi
5552

5653
cd $WORKSPACE
57-
logger "Python py.test for jupyterlab_nvdashboard..."
54+
gpuci_logger "Python py.test for jupyterlab_nvdashboard"
5855
python -m pip install -e .
5956
py.test --cache-clear --junitxml=${WORKSPACE}/junit-nvstrings.xml -v jupyterlab_nvdashboard
6057

61-
logger "Node jlpm test for jupyterlab_nvdashboard..."
58+
gpuci_logger "Node jlpm test for jupyterlab_nvdashboard"
6259
jlpm install
6360
jlpm test
6461
fi

jupyterlab_nvdashboard/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111

1212

1313
def launch_server():
14-
return {"command": [sys.executable, serverfile, '{port}']}
14+
return {"command": [sys.executable, serverfile, "{port}"], "timeout": 20}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyterlab-nvdashboard",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"description": "A JupyterLab extension for displaying GPU usage dashboards",
55
"keywords": [
66
"jupyter",

0 commit comments

Comments
 (0)