Skip to content

Commit

Permalink
chore(template): merge template changes 🆙
Browse files Browse the repository at this point in the history
Signed-off-by: JessicaS11 <[email protected]>
  • Loading branch information
JessicaS11 committed Jul 2, 2024
2 parents 27e49c5 + 5893fa3 commit d547fd6
Show file tree
Hide file tree
Showing 24 changed files with 230 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/template-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ jobs:
source_repo_path: uwhackweek/jupyterbook-template
upstream_branch: main # defaults to main
is_force_deletion: True
<<<<<<< HEAD
git_remote_pull_params: --allow-unrelated-histories --strategy=recursive --no-edit
=======
git_remote_pull_params: --allow-unrelated-histories --squash --strategy=recursive -X theirs
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ cookiecutter.json
/book/_build/html/assets
## Temporary files created by build scripts
/team/team.yaml
<<<<<<< HEAD
/book/reference/gallery.txt
=======
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
32 changes: 31 additions & 1 deletion book/CoC.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< HEAD
# Event Code of Conduct

Guidelines to ensure we offer a hospitable and inclusive event and a list of resources for reporting violations. Although the content is similar, this event Code of Conduct should not be confused with the {{ '[Contributor Covenant Code of Conduct]({url}/{repo}/blob/main/CODE_OF_CONDUCT.md)'.format(url=github_org_url, repo=book_repo) }} governing contributions to this JupyterBook.
Expand Down Expand Up @@ -25,6 +26,19 @@ procedures by which any Code of Conduct incidents are resolved.

In order to foster a positive and professional learning environment we encourage the following kinds of behaviors
on all platforms and during all events, both in-person and online:
=======
# Participant Conduct

We require all participants in the University of Washington (UW) eScience Hackweek program to comply with the [eScience Code of Conduct](https://escience.washington.edu/about/code-of-conduct/) copied below.

Hackweek participants are intentionally diverse across many categories including academic standing, domain field, technical experience, etc., and we expect everyone to respect all perspectives represented. Please also read the [eScience Equity Statement](https://escience.washington.edu/about/equity-statement/).

## Code of Conduct

The University of Washington eScience Institute (“eScience”) is dedicated to providing a welcoming, supportive and inclusive environment for all people, regardless of background and identity. We do not tolerate discrimination or harassment based on characteristics that include, but are not limited to gender, gender identity and expression, sexual orientation, marital status, disability, physical appearance, body size, race, age, national origin or religion. Any form of behavior to exclude, intimidate, or cause discomfort is a violation of the Code of Conduct. By participating in this community, participants accept to abide by the eScience Code of Conduct and accept the procedures by which any Code of Conduct incidents are resolved.

In order to foster a positive and professional learning environment we encourage the following kinds of behaviors on all platforms and during all events, both in-person and online:
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c
* Use welcoming and inclusive language
* Be respectful of different viewpoints and experiences
Expand All @@ -33,9 +47,13 @@ on all platforms and during all events, both in-person and online:

Harassment includes, but is not limited to:

<<<<<<< HEAD
* Written or verbal comments that reinforce social structures of domination related to gender, gender identity
and expression, sexual orientation, marital status, disability, physical appearance, body size, race, age,
national origin or religion
=======
* Written or verbal comments that reinforce social structures of domination related to gender, gender identity and expression, sexual orientation, marital status, disability, physical appearance, body size, race, age, national origin or religion
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c
* Violent threats or language directed against another person
* Sexual language or images in public spaces
* Deliberate intimidation, stalking, or following
Expand All @@ -46,6 +64,7 @@ national origin or religion
* Nonconsensual or unwelcome physical contact
* Advocating for, or encouraging, any of the above behavior

<<<<<<< HEAD
Participants asked to stop any harassing behavior are expected to comply immediately. This applies to any
eScience events or activities, either online or in-person. Participants violating these rules may be
sanctioned or expelled from participation at the discretion of eScience staff. The organizers may take
Expand All @@ -66,4 +85,15 @@ of Washington’s violence-prevention and response program, providing resources
faculty and community members. For more information,
visit their [What to Expect](https://www.washington.edu/safecampus/what-to-expect) page.

Thank you for helping to make our institute inclusive, welcoming and safe.
Thank you for helping to make our institute inclusive, welcoming and safe.
=======
Participants asked to stop any harassing behavior are expected to comply immediately. This applies to any eScience events or activities, either online or in-person. Participants violating these rules may be sanctioned or expelled from participation at the discretion of eScience staff. The organizers may take action to redress anything designed to, or with the clear impact of, disrupting the event or making the environment hostile for any participants. 

Harassment and other code of conduct violations reduce the value of our programming for everyone. If someone makes you or anyone else feel unsafe or unwelcome, please report it as soon as possible. You can make a report either personally or anonymously. To personally report, contact the eScience executive director, Sarah Stone, at [email protected] or another trusted staff member. Anonymous reports can be made [here](https://bit.ly/uwhackweekfeedback). If you are experiencing a problem or issue that needs to be addressed by someone outside the program, you may contact the UW Office of the Ombud at [email protected] or 206-543-6028.

[SafeCampus](https://www.washington.edu/safecampus/) (206-685-7233) is also available at any time to anonymously discuss safety and well-being concerns for yourself and others. SafeCampus is the University of Washington’s violence-prevention and response program, providing resources to UW students, staff, faculty and community members. For more information, visit their [What to Expect](https://www.washington.edu/safecampus/what-to-expect) page.

Thank you for helping to make our institute inclusive, welcoming and safe.


>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c
13 changes: 13 additions & 0 deletions book/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ parts:
chapters:
- file: logistics
- title: Schedule
<<<<<<< HEAD
url: https://2024.hackweek.io/index.html?jump_to=schedule
- title: Team
url: https://2024.hackweek.io/index.html?jump_to=team
=======
url: https://uwhackweek.github.io/jupyterbook-template/index.html?jump_to=schedule
- title: Team
url: https://uwhackweek.github.io/jupyterbook-template/index.html?jump_to=team
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c
- file: CoC
- caption: Preparation
chapters:
Expand All @@ -23,15 +29,22 @@ parts:
- file: tutorials/example/tutorial-notebook
- caption: Projects
chapters:
<<<<<<< HEAD
- file: projects/list_of_projects
- file: projects/index
sections:
- file: projects/project_roadmap
- file: projects/project_initialization
=======
- file: projects/index
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c
- caption: Reference
chapters:
- file: reference/glossary
- file: reference/bibliography
<<<<<<< HEAD
- file: reference/IS2-resources
=======
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c
- file: reference/questions

4 changes: 4 additions & 0 deletions book/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

📖 On this JupyterBook website you'll find [tutorials](tutorials/index). All tutorials are Jupyter Notebooks, designed to be run interactively, but also rendered on this website for convenience.

<<<<<<< HEAD
👩‍💻 During a Hackweek teams work collaboratively on different projects. Read more about the projects and results on our [projects page](projects/list_of_projects)
=======
👩‍💻 During a Hackweek teams work collaboratively on different projects. Read more about the projects and results on our [projects page](projects/index)
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c
💡 Learn more about hackweeks hosted by the [University of Washington eScience Institute](https://uwhackweek.github.io/hackweeks-as-a-service/intro.html), or check out our publication describing the hackweek educational model {cite:p}`Huppenkothen2018`.

Expand Down
25 changes: 24 additions & 1 deletion book/projects/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< HEAD
# Projects

During hackweeks we invite participants to collaborate in small group project teams (usually 5-7 people). Projects provide unique opportunities for networking, advancing research and learning new things.
Expand All @@ -14,4 +15,26 @@ We encourage you to be creative in how you design your project work! Here are so
:class: bg-primary mb-1
:width: 700px
:align: center
```
```
=======
# Projects

During hackweeks we invite participants to collaborate in small group project teams (usually 5-7 people). Projects provide unique opportunities for networking, advancing research and learning new things.

```{image} ../img/projects-montage.png
:alt: picture of people interacting during hackweek project work
:class: bg-primary mb-1
:width: 700px
:align: center
```

You can find our comprehensive guide for organizing projects before, during, and after a hackweek in our [Hackweek Guidebook](https://guidebook.hackweek.io/training/projects/index.html). Below you'll find a table keeping track of all project work done during this event:

## List of Projects

Here is our current list of project for our {{dates}} {{ hackweek }} hackweek:

| Project Name (with link to GitHub repo) | Short Description | Project Lead(s) |
|:--------|:--------|:-----|
| [Snow-Extrapolation](https://github.com/geo-smart/Snow-Extrapolation) | Goal: Improve National Snow Model (NSM) prediction performance in the Sierra Nevada mountains through domain constraints and the exploration of different ML algorithms. | Ryan Johnson |
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c
6 changes: 6 additions & 0 deletions book/tutorials/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Tutorials

<<<<<<< HEAD
These tutorials consist of Jupyter Notebooks that can be run in our
{{ '[preconfigured software environment]({url})'.format(url=jupyterhub_url) }}
If you are attending the hackweek, you have access to a JupyterHub environment
with all the necessary Python software packages installed that are needed to run
through these tutorials interactively. On JupyterHub, your home directory persists
so any changes you make to the tutorials will be saved and be there for you next
time you log in.
=======
Hackweek tutorials are learning-oriented and guide participants through a step-wise process with a meaningful outcome. If you are putting together a new tutorial for this event, refer to our [Hackweek Guidebook](https://guidebook.hackweek.io/training/tutorials/index.html).

Below you'll find a table keeping track of all tutorials presented at this event:
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c
| Tutorial | Topics | Datasets | Recording Link |
| - | - | - | - |
Expand Down
4 changes: 4 additions & 0 deletions conda/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ channels:
- conda-forge
dependencies:
- ipyleaflet
<<<<<<< HEAD
- jupyter-book
=======
- jupyter-book<2
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c
- jupyter-resource-usage
- jupyterhub-singleuser
- jupyterlab
Expand Down
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Recommended Additional Configuration

Some template features require additional GitHub settings. For example, the [netlifypreview.yaml](.github/workflows/netlifypreview.yaml) workflow requires a [netlify account](https://www.netlify.com) and configuring Netlify and GitHub to work together

[github-setup.md](./github-setup.md): Our recommendations for configuring a GitHub organization and managing secrets for a Hackweek

[netlify-setup.md](./netlify-setup.md): Documentation on setting up previews of website changes in pull requests with Netlify
27 changes: 27 additions & 0 deletions docs/github-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# GitHub Setup

## GitHub Organization

We recommend that each hackweek creates a [GitHub Organization](https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/about-organizations) to manage various repositories for an event. This makes organizing teams of users easy and consolidates content such as project work and tutorials for easier discoverability. It also allows managing secrets and making them available to different repositories if necessary.

## Hackweek Bots

For NASA-focused hackweeks we created a "bot" user with a Gmail account, GitHub Account https://github.com/hackweek-admin, and NASA Earthdata login (https://urs.earthdata.nasa.gov) to allow GitHub Actions workflows to access NASA Data with a set of credentials that do not belong to any individual.

## GitHub Actions Secrets

We can add credentials as ["Organization Secrets"](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) and make them available to only select repositories that need them. For example see the screenshots below on giving the `EARTHDATA_PASS` secret to a specific repository

1. ### Repository secrets are under `Settings` -> `Secrets and variables`

For example, replace `snowex-hackweek/website-2024` for your repository in the following URL: https://github.com/snowex-hackweek/website-2024/settings/secrets/actions

**only people with `admin` access to a repository can access these settings**

![Repo secrets](./images/github-repo-secrets.png)

1. ### Select `Manage organization secrets`.

You can either create a new one, or click the "pencil" icon of an existing one to give access to a new repository

![Org Secrets](./images/github-org-secrets-list.png)
Binary file added docs/images/github-org-secrets-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/github-repo-secrets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/github-repo-secrets2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/netlify-addsite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/netlify-auth-token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/netlify-install-github-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/netlify-link-github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/netlify-repo-access.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/netlify-select-org.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/netlify-select-repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/netlify-stop-builds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions docs/netlify-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Configuring Netlify for pull request previews

Public websites for hackweeks have content contributed by many different people, and we want to ensure that they are well-formatted and functional at all times. In order to do this, we "preview" changes to a website to confirm it all looks good before merging new content. There are different ways to accomplish this, but we have found that [Netlify](https://www.netlify.com) is free and works well for previews.

## Link Netlify to a repository

Netlify organizes websites by "Site" which is tied to a specific GitHub repository. *All preview links created are persistent and public but not indexed by search engines.* If you want to delete them, you can delete the 'Site' from Netlify. Importantly, the Netlify previews are completely decoupled from the main website that is hosted by GitHub Pages, so you do not need to worry about overwriting or losing your main event webpage!

1. ### Make sure the Netlify App is installed for your organization

Go to https://github.com/apps/netlify/installations/select_target or visit GitHub Org settings for GitHub Apps (e.g. https://github.com/organizations/snowex-hackweek/settings/installations):

![Add Site](./images/netlify-install-github-app.png)

Under 'Configure' for Netlify you can select which repositories Netlify has access to:

![Add Site](./images/netlify-repo-access.png)

1. ### Log into Netlify and 'Add new site'

![Add Site](./images/netlify-addsite.png)

1. ### Select import an existing project

<img width="365" alt="image" src="https://github.com/uwhackweek/jupyterbook-template/assets/2545978/dffdaca4-dfcf-4ee8-802f-16351486e252">

1. ### Select deploy project with GitHub

![Link GitHub](./images/netlify-link-github.png)

1. ### Select correct GitHub Organization for website repo

![Select org](./images/netlify-select-org.png)

1. ### Select correct repository based on this template (e.g. website-2024)

![Select repo](./images/netlify-select-repo.png)

For 'Site name' enter something informative like `snowex-website-2024` and click 'Deploy'

1. ### Disable netlify main deployment

Important!! We only want to use Netlify for *Previews* so under 'Site Configuration' -> 'Build & Deploy' -> 'Continuous deployment' -> 'Build settings' -> 'Configure' -> select "Stopped Builds" -> Save
(e.g. https://app.netlify.com/sites/snowex-website-2024/configuration/deploys)

If you do not do this, you will have a public mirror of your website available at your netlify site name (https://snowex-website-2024.netlify.app)

![Disable builds](./images/netlify-stop-builds.png)

1. ### Copy unique NETLIFY_SITE_ID to use in GitHub Actions Workflows

Copy the "Site ID" token string under "Site Details", it will look something like this "f9235abc-688d-45e4-8f62-5519ghi455j1"

(e.g. https://app.netlify.com/sites/snowex-website-2024/configuration/general)

1. ### Create a NETLIFY_AUTH_TOKEN to use in GitHub Actions workflows

Go to https://app.netlify.com/user/applications and under 'Personal access token' create a new token with optional expiration. It will look something like this `nfp_8abcUxd2ESPs9yEegb3ATSBst13JicvY135s`

![Auth token](./images/netlify-auth-token.png)


1. ### Add GitHub Action Secrets to your repository

In the end, a website repository needs to have access to both `NETLIFY_AUTH_TOKEN` and a specific `NETLIFY_SITE_ID` for the preview workflow to function:

![Repo secrets final](./images/github-repo-secrets2.png)

In your website repository, go to 'Settings' -> 'Secrets and variables' -> 'Actions' -> 'New repository secret' . Make one for `NETLIFY_SITE_ID` and `NETLIFY_AUTH_TOKEN` with the codes copied in the previous two steps.

1. ### Ensure that the workflow has permission to write issue comments

<img width="1001" alt="image" src="https://github.com/uwhackweek/jupyterbook-template/assets/2545978/5b2333d3-3b21-4ff8-b87e-e29a45f1d0f2">

In your website repository, go to 'Settings' -> 'Actions' -> 'General' and scroll to the section on workflow permissions. Make sure sure that the workflow has read/write permissions. By default, this will be disabled at the organization level, so if the read/write is greyed out, you will need to have a GitHub organization admin change the org level permissions. To do this, go to the GitHub organization then 'Settings' -> 'Actions' -> 'General' and scroll to the section on workflow permissions.

1. ### Trigger your first deploy

Edit a file in GitHub, Commit and create a pull-request. Label the pull request 'preview'. You will need to create the 'preview' label the first time. Once you create the PR with label 'preview', the Netlify workflow will be triggers and when finished a link to a preview of the website will appear in the PR comments.

7 changes: 7 additions & 0 deletions scripts/build_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ check_success() {
fi
}

<<<<<<< HEAD
#printf "Building the splash page -"
#cookiecutter ../. -f --no-input -o ../book/_build

#check_success
=======
printf "Building the splash page -"
cookiecutter ../. -f --no-input -o ../book/_build

check_success
>>>>>>> 5893fa3d37cfbf5e273404627e501c0f8869e56c

echo "Building the Jupyter Book"
cd ../
Expand Down
Loading

0 comments on commit d547fd6

Please sign in to comment.