Skip to content

Commit

Permalink
Merge releases/1.1.0-rc
Browse files Browse the repository at this point in the history
  • Loading branch information
andylassiter committed Mar 4, 2024
2 parents 73660a3 + 92bea54 commit 0819dc0
Show file tree
Hide file tree
Showing 84 changed files with 8,100 additions and 213 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Develop

on:
push:
branches:
- develop

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'zulu'
java-package: jdk

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 6.7

- name: Build JAR with Gradle Wrapper
run: ./gradlew clean jar

- name: Upload JAR
uses: actions/upload-artifact@v4
with:
name: plugin-jar
path: build/libs/*.jar
retention-days: 14
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

jobs:

release:

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'zulu'
java-package: jdk

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 6.7

- name: Build JAR with Gradle Wrapper
run: ./gradlew clean jar

- name: Publish Release
uses: softprops/action-gh-release@v1
with:
files: build/libs/*.jar
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-beta') || contains(github.ref, '-alpha') }}
body: The plugin JAR is attached to this release.
29 changes: 28 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,43 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0-rc.snapshot] - 2024-02-06

### Added

- [JHP-73][]: Adds dashboards functionality to the JupyterHub plugin. May require browser cache to be cleared.
- [XNAT-7903][] and [JHP-74][]: Support mounting of shared data at the project level.
- [JHP-70]: Adds capability to configure plugin preferences via environment variables at startup.

### Changed

- [JHP-66][] and [XNAT-7867][]: Moves the compute services code from the plugin to the XNAT core to allow other plugins
to use the compute services. Makes the plugin dependent on XNAT 1.8.10 or later.
- [JHP-77][]: Add GitHub workflows to build the develop branch and publish releases. Move the build process to GitHub
Actions and remove the Jenkins build process. Repository has migrated from
[Bitbucket](https://bitbucket.org/xnatx/xnat-jupyterhub-plugin/) to
[GitHub](https://github.com/NrgXnat/xnat-jupyterhub-plugin)


## [1.0.1] - 2023-10-12

### Features
### Added

- Added changelog.

### Fixed

- [JHP-68][]: Updates date format patterns in the Server, Token, and User class to handle optional fractions of seconds.
- [JHP-69][]: Adds a new preference for JupyterHub Host URL. This preference is used to build the URL for linking users
to their Jupyter notebook server. Addresses an issue encountered in multi-node XNAT deployments.
The new preference will default to the site URL (which will keep the current behavior).

[XNAT-7867]: https://radiologics.atlassian.net/browse/XNAT-7867
[XNAT-7903]: https://radiologics.atlassian.net/browse/XNAT-7903
[JHP-66]: https://radiologics.atlassian.net/jira/software/c/projects/JHP/issues/JHP-66
[JHP-68]: https://radiologics.atlassian.net/jira/software/c/projects/JHP/issues/JHP-68
[JHP-69]: https://radiologics.atlassian.net/jira/software/c/projects/JHP/issues/JHP-69
[JHP-70]: https://radiologics.atlassian.net/jira/software/c/projects/JHP/issues/JHP-70
[JHP-73]: https://radiologics.atlassian.net/jira/software/c/projects/JHP/issues/JHP-73
[JHP-74]: https://radiologics.atlassian.net/jira/software/c/projects/JHP/issues/JHP-74
[JHP-77]: https://radiologics.atlassian.net/jira/software/c/projects/JHP/issues/JHP-77
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# XNAT JupyterHub Plugin

[XNAT](https://www.xnat.org) plugin for integrating with [JupyterHub](https://jupyter.org/hub). You will need to have a
running instance of the [xnat/jupyterhub](https://hub.docker.com/r/xnat/jupyterhub) Docker image to use this plugin
([source](https://bitbucket.org/xnat-containers/xnat-jupyterhub)). See the
[XNAT Jupyter Integration Wiki](https://wiki.xnat.org/jupyter-integration) for the latest documentation.
[XNAT](https://www.xnat.org) plugin for integrating with [JupyterHub](https://jupyter.org/hub).

The plugin jar is available on the [downloads page](https://bitbucket.org/xnatx/xnat-jupyterhub-plugin/downloads/)
and on [XNAT's CI server](https://ci.xnat.org/job/Plugins_Release/job/JupyterHub).
See the [XNAT JupyterHub Plugin Wiki](https://wiki.xnat.org/jupyter-integration) for the latest documentation on this
plugin.

## Building the JAR

Expand Down
60 changes: 13 additions & 47 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ plugins {
id "java"
id "org.nrg.xnat.build.xnat-data-builder" version "1.8.8"
id "io.freefair.lombok" version "6.0.0-m2"
id "com.palantir.git-version" version "0.12.1"
id "jacoco"
}

group "org.nrg.xnatx.plugins"
version "1.0.1"
version "1.1.0-rc.snapshot"
description "JupyterHub Plugin for XNAT"

repositories {
mavenLocal()
maven { url "https://nrgxnat.jfrog.io/nrgxnat/libs-release" }
maven { url "https://nrgxnat.jfrog.io/nrgxnat/libs-snapshot" }
mavenLocal()
mavenCentral()
maven { url "https://www.dcm4che.org/maven2" }
}
Expand All @@ -28,7 +27,7 @@ configurations {
}

dependencies {
xnatProvided platform("org.nrg:parent:1.8.8.1")
xnatProvided platform("org.nrg:parent:1.8.10-RC-SNAPSHOT")
xnatProvided "org.nrg:framework"
xnatProvided "org.nrg.xnat:xnat-data-models"
xnatProvided "org.nrg.xnat:web"
Expand Down Expand Up @@ -57,54 +56,21 @@ test {
useJUnit()
}

// Pulls in the Jenkins BUILD_NUMBER environment variable if available.
def buildDate = new Date()
def buildNumber = System.getenv().BUILD_NUMBER?.toInteger() ?: "Manual"
def isDirty, branchName, gitHash, gitHashFull, commitDistance, lastTag, isCleanTag

try {
def gitDetails = versionDetails()
isDirty = gitVersion().endsWith ".dirty"
branchName = gitDetails.branchName ?: "Unknown"
gitHash = gitDetails.gitHash
gitHashFull = gitDetails.gitHashFull
commitDistance = gitDetails.commitDistance
lastTag = gitDetails.lastTag
isCleanTag = gitDetails.isCleanTag
} catch (IllegalArgumentException ignored) {
logger.info "Got an error trying to read VCS metadata from git. It's possible this project is not under VCS control. Using placeholder values for manifest entries."
isDirty = true
branchName = "Unknown"
gitHash = "None"
gitHashFull = "None"
commitDistance = 0
lastTag = "None"
isCleanTag = false
}

logger.info "Build-Date: ${buildDate}"
logger.info "Build-Number: ${buildNumber}"
logger.info "Implementation-Version: ${version}"
logger.info "Implementation-Sha-Full: ${gitHashFull}"
logger.info "Implementation-Sha: ${gitHash}"
logger.info "Implementation-Commit: ${commitDistance}"
logger.info "Implementation-LastTag: ${lastTag}"
logger.info "Implementation-Branch: ${branchName}"
logger.info "Implementation-CleanTag: ${isCleanTag}"
logger.info "Implementation-Dirty: ${isDirty}"
// Pulls in GitHub Actions environment variables if available.
def github_actor = System.getenv().GITHUB_ACTOR ?: "Unknown"
def github_repo = System.getenv().GITHUB_REPOSITORY ?: "Unknown"
def github_sha = System.getenv().GITHUB_SHA ?: "Unknown"
def github_ref = System.getenv().GITHUB_REF ?: "Unknown"

ext.gitManifest = manifest {
attributes "Application-Name": "XNAT-JUPYTERHUB-PLUGIN",
attributes "Application-Name": "PIXI-PLUGIN",
"Build-Date": buildDate,
"Build-Number": buildNumber,
"Implementation-Version": project.version,
"Implementation-Sha": gitHash,
"Implementation-Sha-Full": gitHashFull,
"Implementation-Commit": commitDistance,
"Implementation-LastTag": lastTag,
"Implementation-Branch": branchName,
"Implementation-CleanTag": isCleanTag,
"Implementation-Dirty": isDirty
"GITHUB-ACTOR": github_actor,
"GITHUB-REPO": github_repo,
"GITHUB-SHA": github_sha,
"GITHUB-REF": github_ref
}

jacocoTestReport {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import lombok.extern.slf4j.Slf4j;
import org.nrg.framework.annotations.XnatPlugin;
import org.nrg.xnat.compute.config.ComputeConfig;
import org.nrg.xdat.security.helpers.UserHelper;
import org.nrg.xdat.security.services.SearchHelperServiceI;
import org.nrg.xnatx.plugins.jupyterhub.client.DefaultJupyterHubClient;
Expand All @@ -20,7 +19,7 @@
@XnatPlugin(value = "jupyterHubPlugin",
name = "XNAT JupyterHub Plugin",
logConfigurationFile = "jupyterhub-logback.xml",
entityPackages = {"org.nrg.xnatx.plugins.jupyterhub.entities", "org.nrg.xnat.compute.entities"})
entityPackages = {"org.nrg.xnatx.plugins.jupyterhub.entities"})
@ComponentScan({"org.nrg.xnatx.plugins.jupyterhub.preferences",
"org.nrg.xnatx.plugins.jupyterhub.client",
"org.nrg.xnatx.plugins.jupyterhub.rest",
Expand All @@ -30,9 +29,7 @@
"org.nrg.xnatx.plugins.jupyterhub.listeners",
"org.nrg.xnatx.plugins.jupyterhub.repositories",
"org.nrg.xnatx.plugins.jupyterhub.utils",
"org.nrg.xnatx.plugins.jupyterhub.authorization",
"org.nrg.xnatx.plugins.jupyterhub.initialize"})
@Import({ComputeConfig.class})
@Slf4j
public class JupyterHubPlugin {

Expand Down Expand Up @@ -65,4 +62,9 @@ public TriggerTask cullLongRunningServers(final JupyterHubService jupyterHubServ
return new TriggerTask(jupyterHubService::cullLongRunningServers, new PeriodicTrigger(5, TimeUnit.MINUTES));
}

@Bean
public TriggerTask cullDeadServerSharedFolders(final JupyterHubService jupyterHubService) {
return new TriggerTask(jupyterHubService::cleanupOrphanedSharedDataDirs, new PeriodicTrigger(1, TimeUnit.DAYS));
}

}
Loading

0 comments on commit 0819dc0

Please sign in to comment.