Skip to content

Commit

Permalink
Merge branch 'main' into hub-update
Browse files Browse the repository at this point in the history
  • Loading branch information
enolfc authored Oct 2, 2024
2 parents 3736813 + 89bd333 commit 67d4fa7
Show file tree
Hide file tree
Showing 33 changed files with 1,959 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

# Runs the Super-Linter action
- name: Run Super-Linter on new changes
uses: github/super-linter@v6
uses: github/super-linter@v7
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -33,3 +33,7 @@ jobs:
# Pylint is too picky about everything, not ready
# for this yet here
VALIDATE_PYTHON_PYLINT: false
# this messes with jinja templates
VALIDATE_HTML_PRETTIER: false
# We don't want to lint EC files
FILTER_REGEX_EXCLUDE: ".*/ecl-.*\\.(css|js)"
67 changes: 63 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,79 @@
<!-- markdownlint-disable MD024 -->

# Changelog

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/),
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.0] - 2024-10-02

### Added
- More flexible templates for the hub

- Better templates
[#101](https://github.com/EGI-Federation/egi-notebooks-hub/pull/101)
- D4Science: filter profiles depending on the server name
[#105](https://github.com/EGI-Federation/egi-notebooks-hub/pull/105)
- D4Science: Support data manager role for volumes
[#106](https://github.com/EGI-Federation/egi-notebooks-hub/pull/106)
- D4Science: set CPU guarantee depending on limit
[#107](https://github.com/EGI-Federation/egi-notebooks-hub/pull/107)
- D4Science: support Ophidia
[#115](https://github.com/EGI-Federation/egi-notebooks-hub/pull/115)
- Support for JWT authentication and proxy service
[#119](https://github.com/EGI-Federation/egi-notebooks-hub/pull/119),
[#122](https://github.com/EGI-Federation/egi-notebooks-hub/pull/122),
[#123](https://github.com/EGI-Federation/egi-notebooks-hub/pull/123),
[#127](https://github.com/EGI-Federation/egi-notebooks-hub/pull/127),
[#135](https://github.com/EGI-Federation/egi-notebooks-hub/pull/135)
- Add version to the package
[#124](https://github.com/EGI-Federation/egi-notebooks-hub/pull/124)
- EOSC Node AAI support
[#121](https://github.com/EGI-Federation/egi-notebooks-hub/pull/121)
- D4Science: support for GKE deployment
[#117](https://github.com/EGI-Federation/egi-notebooks-hub/pull/117)
- EC Templates
[#131](https://github.com/EGI-Federation/egi-notebooks-hub/pull/131),
[#132](https://github.com/EGI-Federation/egi-notebooks-hub/pull/132),
[#133](https://github.com/EGI-Federation/egi-notebooks-hub/pull/133),
[#134](https://github.com/EGI-Federation/egi-notebooks-hub/pull/134)
- Support anonymous users from AAI
[#136](https://github.com/EGI-Federation/egi-notebooks-hub/pull/136)
- Configurable leeway time for token refresh
[#137](https://github.com/EGI-Federation/egi-notebooks-hub/pull/137)

### Changed

- Update GitHub Actions dependencies
[#104](https://github.com/EGI-Federation/egi-notebooks-hub/pull/104),
[#110](https://github.com/EGI-Federation/egi-notebooks-hub/pull/110),
[#111](https://github.com/EGI-Federation/egi-notebooks-hub/pull/111),
[#112](https://github.com/EGI-Federation/egi-notebooks-hub/pull/112),
[#109](https://github.com/EGI-Federation/egi-notebooks-hub/pull/109),
[#113](https://github.com/EGI-Federation/egi-notebooks-hub/pull/113),
[#114](https://github.com/EGI-Federation/egi-notebooks-hub/pull/114),
[#120](https://github.com/EGI-Federation/egi-notebooks-hub/pull/120),
[#118](https://github.com/EGI-Federation/egi-notebooks-hub/pull/118),
[#129](https://github.com/EGI-Federation/egi-notebooks-hub/pull/129)
- Upgrade dependencies k8s-hub (3.2.1), jupyterhub (4.0.2),
oauthenticator(16.1.0), kubespawner(6.1.0)
- Add new dependencies: fastapi, pydantic-settings, pbr
- Update to Changelog 1.1.0

### Fixed
- Fixed the update of the secret with the renewed access token
- Use "Privacy Notice" instead of "Privacy Policy"

- Secret handling for tokens
[#103](https://github.com/EGI-Federation/egi-notebooks-hub/pull/103)
- D4Science: pick roles from the right token
[#108](https://github.com/EGI-Federation/egi-notebooks-hub/pull/108)
- Do not try to refresh non Check-in users
[#116](https://github.com/EGI-Federation/egi-notebooks-hub/pull/116)
- Fix profile filter
[#125](https://github.com/EGI-Federation/egi-notebooks-hub/pull/125)

## [0.1.0] - 2023-03-06

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Jupyterhub with some adjustments to make it EGI friendly:

* EGI Check-in authenticator
* EGI Spawner
* EGI DataHub integration
- EGI Check-in authenticator
- EGI Spawner
- EGI DataHub integration
2 changes: 2 additions & 0 deletions ec-templates/401.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- htmlhint doctype-first:false -->
{% extends "403.html" %}
18 changes: 18 additions & 0 deletions ec-templates/403.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- htmlhint doctype-first:false -->
{% extends "error.html" %}
{% block main %}
<div class="ecl-container ecl-u-mv-xl container-fix">
<h1>Unauthorized!</h1>
<p>
Access to European Open Science Cloud - EU Node Interactive Notebooks is
restricted to allowed users, please check your permissions at your
<a href="https://open-science-cloud.ec.europa.eu/">EU Node profile</a>
</p>
<p>
If you think you should be granted access already, please open an issue in
<a href="https://open-science-cloud.ec.europa.eu/support/helpdesk"
>the Helpdesk</a
>
</p>
</div>
{% endblock %}
17 changes: 17 additions & 0 deletions ec-templates/admin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- htmlhint doctype-first:false,id-class-value:false -->
{% extends "page.html" %}

{% block main %}
<div class="ecl-container ecl-u-mv-xl container-fix">
<div id="react-admin-hook">
<script id="jupyterhub-admin-config">
window.api_page_limit = parseInt("{{ api_page_limit|safe }}");
window.base_url = "{{ base_url|safe }}";
</script>
<script src="{{ static_url('js/admin-react.js') }}"></script>
</div>
<div class="container-fluid navbar-default small version_footer">
<div class="navbar-text">JupyterHub {{ server_version }}</div>
</div>
</div>
{% endblock %}
60 changes: 60 additions & 0 deletions ec-templates/egi-login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!-- htmlhint doctype-first:false,id-class-value:false -->
{% extends "page.html" %}
{% if announcement_login %}
{% set announcement = announcement_login %}
{% endif %}

{% block main %}
<div id="main-page-content" class="ecl-u-mb-l container-fix">
<article>
<div>
<div class="ecl-u-mb-2xl">
<div>
<section
class="ecl-banner ecl-banner--text-highlight ecl-banner--m ecl-banner--full-width"
>
<picture class="ecl-picture ecl-banner__picture"
><img
class="ecl-banner__image"
src="{{ static_url('images/EOSC-Visuals-Interactive-Notebooks-blue-2.jpg') }}"
alt="Interactive notebooks"
/></picture>
<div class="ecl-container">
<div class="ecl-banner__container">
<div class="ecl-banner__content">
<div class="ecl-banner__title">
<span class="ecl-banner__title-text"
>Interactive Notebooks</span
>
</div>
<p class="ecl-banner__description">
<span class="ecl-banner__description-text"
>Create and share documents with real-time code
execution.</span
>
</p>
<div class="ecl-banner__cta">
<a
href="{{ authenticator_login_url }}"
class="ecl-link ecl-link--cta ecl-link--icon ecl-link--icon-after ecl-banner__link-cta"
><span class="ecl-link__label">Get Started</span
><svg
class="ecl-icon ecl-icon--xs ecl-icon--rotate-90 ecl-link__icon"
focusable="false"
aria-hidden="true"
>
<use
xlink:href="{{ static_url('images/icons.svg#corner-arrow') }}"
></use></svg
></a>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</article>
</div>
{% endblock main %}
45 changes: 45 additions & 0 deletions ec-templates/error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!-- htmlhint doctype-first:false -->
{% extends "page.html" %}
{% block login_widget %}
{% endblock login_widget %}
{% block main %}
<div class="ecl-container ecl-u-mv-xl container-fix">
{% block h1_error %}
<h1>{{ status_code }} : {{ status_message }}</h1>
{% endblock h1_error %}
{% block error_detail %}
{% if message %}<p>{{ message }}</p>{% endif %}
{% if message_html %}<p>{{ message_html | safe }}</p>{% endif %}
{% if extra_error_html %}<p>{{ extra_error_html | safe }}</p>{% endif %}
{% endblock error_detail %}
</div>
{% endblock main %}
{% block script %}
{{ super() }}
<script type="text/javascript">
function _remove_redirects_from_url() {
if (window.location.search.length <= 1) {
return;
}
var search_parameters = window.location.search.slice(1).split('&');
for (var i = 0; i < search_parameters.length; i++) {
if (search_parameters[i].split('=')[0] === 'redirects') {
// remote redirects from search parameters
search_parameters.splice(i, 1);
var new_search = '';
if (search_parameters.length) {
new_search = '?' + search_parameters.join('&');
}
var new_url = window.location.origin +
window.location.pathname +
new_search +
window.location.hash;
window.history.replaceState({}, "", new_url);
return;
}
}
}

_remove_redirects_from_url();
</script>
{% endblock script %}
116 changes: 116 additions & 0 deletions ec-templates/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<!-- htmlhint doctype-first:false,id-class-value:false,spec-char-escape:false -->
{% extends "page.html" %}
{% if announcement_home is string %}
{% set announcement = announcement_home %}
{% endif %}

{% block main %}
<div class="ecl-container ecl-u-mv-xl container-fix">
<h1 class="sr-only">JupyterHub home page</h1>
<div class="row">
<div class="text-center">
{% if default_server.active %}
<a id="stop" role="button" class="ecl-button ecl-button--secondary"
>Stop My Server</a
>
{% endif %}
<a
id="start"
role="button"
class="ecl-button ecl-button--primary"
href="{{ url }}"
>
{% if not default_server.active %}Start{% endif %} My Server
</a>
</div>
</div>
{% if allow_named_servers %}
<h2>Named Servers</h2>
<p>
In addition to your default server, you may have additional
{% if named_server_limit_per_user > 0 %}{{ named_server_limit_per_user }}{% endif %}
server(s) with names. This allows you to have more than one server
running at the same time.
</p>
{% set named_spawners = user.all_spawners(include_default=False)|list %}
<table class="server-table table table-striped">
<thead>
<tr>
<th>Server name</th>
<th>URL</th>
<th>Last activity</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr class="home-server-row add-server-row">
<td colspan="4">
<div class="input-group">
<input
class="new-server-name form-control"
aria-label="server name"
placeholder="name-your-server"
/>
<button
role="button"
type="button"
class="new-server-btn ecl-button ecl-button--primary btn-xs"
>
Add New Server
</button>
</div>
</td>
</tr>
{% for spawner in named_spawners %}
<tr class="home-server-row" data-server-name="{{ spawner.name }}">
{# name #}
<td>{{ spawner.name }}</td>
{# url #}
<td>
<a
class="server-link {% if not spawner.ready %}hidden{% endif %}"
href="{{ user.server_url(spawner.name) }}"
>{{ user.server_url(spawner.name) }}</a
>
</td>
{# activity #}
<td class="time-col">
{% if spawner.last_activity %} {{ spawner.last_activity.isoformat() + 'Z' }} {% else %} Never {% endif %}
</td>
{# actions #}
<td>
<a
role="button"
class="stop-server btn-xs ecl-button ecl-button--secondary {% if not spawner.active %} hidden{% endif %}"
id="stop-{{ spawner.name }}"
>stop</a
>
<a
role="button"
class="start-server btn-xs ecl-button ecl-button--primary {% if spawner.active %}hidden{% endif %}"
id="start-{{ spawner.name }}"
href="{{ base_url }}spawn/{{ user.name }}/{{ spawner.name }}"
>start</a
>
<button
role="button"
class="delete-server btn-xs ecl-button ecl-button--secondary {% if spawner.active %} hidden{% endif %}"
id="delete-{{ spawner.name }}"
>
delete
</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
{% endblock main %}

{% block script %}
{{ super() }}
<script type="text/javascript">
require(["home"]);
</script>
{% endblock %}
2 changes: 2 additions & 0 deletions ec-templates/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- htmlhint doctype-first:false -->
{% extends "egi-login.html" %}
14 changes: 14 additions & 0 deletions ec-templates/logout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- htmlhint doctype-first:false -->
{% extends "page.html" %}
{% block meta %}
<meta http-equiv="refresh" content="0; url=/" />
{% endblock %}
{% if announcement_logout %}
{% set announcement = announcement_logout %}
{% endif %}

{% block main %}
<div id="logout-main" class="ecl-container">
<p>Successfully logged out.</p>
</div>
{% endblock %}
Loading

0 comments on commit 67d4fa7

Please sign in to comment.