From a629662c285ae8c778f7a474bb14ec2a8f52075a Mon Sep 17 00:00:00 2001 From: tdstein Date: Mon, 27 Feb 2023 13:00:53 -0500 Subject: [PATCH 1/3] Add deployment instructions to CONTRIBUTING.md. --- CONTRIBUTING => CONTRIBUTING.md | 53 ++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 7 deletions(-) rename CONTRIBUTING => CONTRIBUTING.md (51%) diff --git a/CONTRIBUTING b/CONTRIBUTING.md similarity index 51% rename from CONTRIBUTING rename to CONTRIBUTING.md index 0e0061be..bd6875c4 100644 --- a/CONTRIBUTING +++ b/CONTRIBUTING.md @@ -1,9 +1,27 @@ -# User Guide +# Contributing Guidelines -Installation and usage instructions are available -[here](https://github.com/rstudio/rsconnect-jupyter/tree/master/docs). +This documentation covers common tasks releated to development. -# Developing `rsconnect-jupyter` +For installation and usage instructions see [README.md](./README.md). + + +**Table of Contents** + +- [Contributing Guidelines](#contributing-guidelines) +- [Development](#development) + - [Trying out notebooks](#trying-out-notebooks) + - [Seeing code changes](#seeing-code-changes) +- [Packaging](#packaging) +- [Versioning and Releases](#versioning-and-releases) + - [Versioning](#versioning) + - [Releases](#releases) + - [Releasing on Conda Forge](#releasing-on-conda-forge) + - [Adding yourself as a rsconnect-jupyter conda-forge maintainer](#adding-yourself-as-a-rsconnect-jupyter-conda-forge-maintainer) + + + + +# Development Need to run this after checkout and when modifying the docker images @@ -49,10 +67,31 @@ The following will create a universal [wheel](https://pythonwheels.com/) ready to be installed in any python 2 or python 3 environment. make package +# Versioning and Releases + +## Versioning + +Versioning is accomplished via Git tagging using [Semantic Versioning](https://semver.org/). Read more about tagging [here](https://git-scm.com/book/en/v2/Git-Basics-Tagging). +o view the most recent release tag, execute the following. + +```shell +git describe master --match "v*" --tags +``` + +## Releases + +Releases are accomplished through GitHub Actions. + +To initiate a release, create a manual tag use the following steps. The `..` values **MUST** follow semantic versioning. -## Updating rsconnect-jupyter on conda-forge + git tag v.. + git push origin v.. -rsconnect-jupyter exists on conda-forge as its own [feedstock](https://github.com/conda-forge/rsconnect-jupyter-feedstock) +Once pushed, a GitHub Action will be trigged. This action with publish the release to [PyPi](https://pypi.org/project/rsconnect-jupyter/) using the specified version. + +### Releasing on Conda Forge + +`rsconnect-jupyter` exists on conda-forge as its own [feedstock](https://github.com/conda-forge/rsconnect-jupyter-feedstock) Updating the package requires a fork of the repository and a push request [example workflow](https://conda-forge.org/docs/maintainer/updating_pkgs.html#example-workflow-for-updating-a-package). @@ -60,7 +99,7 @@ Updating the package requires a fork of the repository and a push request [examp - For a rebuild of the same version, increase "number" under "build" by one in the [meta.yaml](https://github.com/conda-forge/rsconnect-jupyter-feedstock/blob/master/recipe/meta.yaml) file. - ### Adding yourself as a rsconnect-jupyter conda-forge maintainer Add your github username under recipe-maintainers in the [meta.yaml](https://github.com/conda-forge/rsconnect-jupyter-feedstock/blob/master/recipe/meta.yaml) file. + From 49f1d17d5258ed69cf0303a7d681394d052d0af2 Mon Sep 17 00:00:00 2001 From: tdstein Date: Wed, 1 Mar 2023 11:47:09 -0500 Subject: [PATCH 2/3] Removes all references to Python 2. --- CONTRIBUTING.md | 12 +++--------- Jenkinsfile | 3 --- notebooks2/.keep | 0 3 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 notebooks2/.keep diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd6875c4..694f5aec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing Guidelines -This documentation covers common tasks releated to development. +This documentation covers common tasks related to development. For installation and usage instructions see [README.md](./README.md). @@ -20,25 +20,19 @@ For installation and usage instructions see [README.md](./README.md). - # Development Need to run this after checkout and when modifying the docker images make images -Launch jupyter in a python 2 environment - - make notebook2 - Launch jupyter in a python 3 environment make notebook3 ## Trying out notebooks -> Note: notebooks in the `notebooks2` and `notebooks3` directories will be -> available in respective python environments. +> Note: notebooks in the `notebooks3` directories will be available in respective python environments. Sample notebooks can be obtained from: @@ -101,5 +95,5 @@ Updating the package requires a fork of the repository and a push request [examp ### Adding yourself as a rsconnect-jupyter conda-forge maintainer -Add your github username under recipe-maintainers in the [meta.yaml](https://github.com/conda-forge/rsconnect-jupyter-feedstock/blob/master/recipe/meta.yaml) file. +Add your GitHub username under recipe-maintainers in the [meta.yaml](https://github.com/conda-forge/rsconnect-jupyter-feedstock/blob/master/recipe/meta.yaml) file. diff --git a/Jenkinsfile b/Jenkinsfile index 74c4edd8..7cafd894 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -124,9 +124,6 @@ try { stage('Docker build and test') { parallel( - 'python2.7': { - buildAndTest("2.7") - }, 'python3.5': { img = buildAndTest("3.5") }, diff --git a/notebooks2/.keep b/notebooks2/.keep deleted file mode 100644 index e69de29b..00000000 From 19f7d0249ff7aac122f05413606d0e43abc9f8fd Mon Sep 17 00:00:00 2001 From: Taylor Steinberg Date: Thu, 2 Mar 2023 10:28:32 -0500 Subject: [PATCH 3/3] Delete Jenkinsfile --- Jenkinsfile | 198 ---------------------------------------------------- 1 file changed, 198 deletions(-) delete mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 7cafd894..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,198 +0,0 @@ -#!groovy - -def gitClean() { - // inspired by: https://issues.jenkins-ci.org/browse/JENKINS-31924 - // https://issues.jenkins-ci.org/browse/JENKINS-32540 - // The sequence of reset --hard and clean -fdx first - // in the root and then using submodule foreach - // is based on how the Jenkins Git SCM clean before checkout - // feature works. - sh 'git reset --hard' - sh 'git clean -ffdx' -} - -// Build the name:tag for a docker image where the tag is the checksum -// computed from a specified file. -def imageName(name, filenames) { - // If this is extended to support multiple files, be wary of: - // https://issues.jenkins-ci.org/browse/JENKINS-26481 - // closures don't really work. - - // Suck in the contents of the file and then hash the result. - def contents = ""; - for (int i=0; i" - - // Looking up the author also demands being in a `node`. - gitAuthor = sh(returnStdout: true, script: 'git --no-pager show -s --format="%aN" HEAD').trim() - - stage('Docker build and test') { - parallel( - 'python3.5': { - img = buildAndTest("3.5") - }, - 'python3.6': { - img = buildAndTest("3.6") - - img.inside("-v ${env.WORKSPACE}:/rsconnect_jupyter") { - sh "pip install --user --upgrade twine setuptools wheel" - print "building python wheel package" - sh 'make dist' - archiveArtifacts artifacts: 'dist/*.whl,dist/*.tar.gz' - stash includes: 'dist/*.whl,dist/*.tar.gz', name: 'wheel' - } - }, - 'python3.7': { - img = buildAndTest("3.7") - }, - 'code-quality': { - def uid = sh (script: 'id -u jenkins', returnStdout: true).trim() - def gid = sh (script: 'id -g jenkins', returnStdout: true).trim() - img = pullBuildPush( - image_name: 'jenkins/rsconnect-jupyter-yarn', - image_tag: 'latest', - docker_context: './tools/yarn', - build_arg_nb_uid: 'JENKINS_UID', - build_arg_nb_gid: 'JENKINS_GID', - build_args: "--build-arg NB_UID=${uid} --build-arg NB_GID=${gid}", - push: !isUserBranch - ) - img.inside("-v ${env.WORKSPACE}:/rsconnect_jupyter") { - sh 'make yarn' - sh 'make lint' - } - } - ) - } - stage('Docs build') { - docs_image = pullBuildPush( - image_name: 'jenkins/rsconnect-jupyter', - image_tag: 'docs', - docker_context: './docs', - push: !isUserBranch - ) - docs_image.inside("-v ${env.WORKSPACE}:/rsconnect_jupyter") { - sh 'make docs-build' - archiveArtifacts artifacts: 'dist/*.pdf,dist/*.html' - stash includes: 'dist/*.pdf,dist/*.html', name: 'docs' - } - } - stage('S3 upload') { - unstash 'wheel' - unstash 'docs' - publishArtifacts() - } - } - } - - // Slack message includes username information. - message = "${messagePrefix} by ${gitAuthor} passed" - slackSend channel: slackChannelPass, color: 'good', message: message -} catch(err) { - // Slack message includes username information. When master/release fails, - // CC the whole connect team. - slackNameFail = "unknown" - if (!isUserBranch) { - slackNameFail = "${gitAuthor} (cc @rsconnect_jupyter)" - } - - message = "${messagePrefix} by ${slackNameFail} failed: ${err}" - slackSend channel: slackChannelFail, color: 'bad', message: message - throw err -}