Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitpod config to be used for tutorials #1093

Merged
merged 23 commits into from
Mar 19, 2022
Merged

gitpod config to be used for tutorials #1093

merged 23 commits into from
Mar 19, 2022

Conversation

lescai
Copy link
Contributor

@lescai lescai commented Mar 17, 2022

This PR is meant to create a specific .gitpod.yml config file, to be used for running tutorials on a gitpod environment.
Reason for branch: the master branch contains a .gitpod.yml that serves an environment needed for the website development.
This PR changes 2 files:

  1. .gitpod.yml
    simplified and uses the nf-core/gitpod image containing nextflow and nf-core tools
    also opens automatically the usage tutorial page
  2. .vscode/settings.json
    this reconfigs VScode in order not to open the welcome page, and allow full width display of the nf-core tutorial page

A separate PR is going to be submitted in order to insert the gitpod button into the tutorial page.

relates to carpentries-incubator/workflows-nextflow#68

@ewels
Copy link
Member

ewels commented Mar 17, 2022

See the orphan branch I made for this: https://github.com/nf-core/nf-co.re/tree/gitpod_config_training_orphan

what do you think about that approach, to keep the branch as minimal as possible?

@lescai
Copy link
Contributor Author

lescai commented Mar 17, 2022

done but now it conflicts on three files which I don't have anymore on my fork.
I've followed the suggestions but everything is up to date on my side.
Any good suggestions?

@ewels
Copy link
Member

ewels commented Mar 17, 2022

If we're doing an orphan branch then you can't PR to it from here, as there's no shared git history. You can also just delete everything as you did in the last commit though, I guess that works too.

Those conflicting files will have been changed since you forked this branch. You'll need to resolve the conflict locally by accepting that they should be deleted despite the upstream changes.

@lescai
Copy link
Contributor Author

lescai commented Mar 18, 2022

alright should be good now :) thanks!

@lescai
Copy link
Contributor Author

lescai commented Mar 18, 2022

this is now working.
as I mentioned on PR #1094 that's connected to this one, the variable passed through the URL conflicts with url of the repo if contains url-characters, therefore the only solution I could think about was making substitutions then parsed in the config.
if there's more elegant suggestions, they're welcome of course.
this is tested and working.

- init: git checkout gitpod_exercises
- command: |
parsed=`echo $url | tr -s "[" "/" | tr -s "+" "."`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this parses the string

https://gitpod.io/#url=nf-co+re[usage[tutorials[nf_core_usage_tutorial/https://github.com/nf-core/nf-co.re/blob/gitpod_config_training/

Parts of the URL:

https://gitpod.io/#                                              // Gitpod prefix
url=nf-co+re[usage[tutorials[nf_core_usage_tutorial              // Value pair, separate by commas
https://github.com/nf-core/nf-co.re/blob/gitpod_config_training/ // Repo + branch to open

Does URL encoding work (it says the values are URL encoded)? https://www.urlencoder.org/

https://carpentries-incubator.github.io/workflows-nextflow/01-getting-started-with-nextflow/index.html

becomes

https%3A%2F%2Fcarpentries-incubator.github.io%2Fworkflows-nextflow%2F01-getting-started-with-nextflow%2Findex.html

How can I test this? I tried editing the other page https://github.com/nf-core/nf-co.re/pull/1094/files
but then I can't get to the button in the preview browser.

We may just be over complicating things here though.
What would be nice is just:
teaching_view

So a preview panel with the website (using gp preview URL and it's navigable)
And then as large a terminal as possible. I moved the terminal position to the right to have them side by side.
( Menu > View > Appearance > Panel position > right ).
Then they can do all their work in an exercises folder and not have to worry about all the other distractions along the side.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was too focused on carpentries material before and forgot we have two use cases here.

For the nf-core training material we want buttons on each page as they are standalone training guides, so we should definitely see if URL encoding is sufficient to open the correct URL with gp preview.

The Carpentries Workshop though just needs to start from the setup page and can have a simpler link.

@lescai
Copy link
Contributor Author

lescai commented Mar 19, 2022

Hi @mahesh-panchal I'll merge this one so you'll be able to fully test the link on PR #1094 (comment) which relies on the existence of the correct config in this branch to work.
It's been tested on the forked repo but I've had to change repo and branch name of course before submitting it for merging into nf-core so until this branch is merged it won't work :)

@lescai lescai merged commit 5cd5dd4 into nf-core:gitpod_config_training Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants