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

docs: developer documentation #2275

Merged
merged 4 commits into from
Jan 9, 2023
Merged

docs: developer documentation #2275

merged 4 commits into from
Jan 9, 2023

Conversation

ciyer
Copy link
Contributor

@ciyer ciyer commented Jan 5, 2023

Developer documentation

Fix #2165

@ciyer ciyer changed the title WIP docs: developer documentation docs: developer documentation Jan 6, 2023
@ciyer ciyer marked this pull request as ready for review January 6, 2023 12:14
@ciyer ciyer requested a review from a team as a code owner January 6, 2023 12:14
Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi left a comment

Choose a reason for hiding this comment

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

This documentation is great! Sections are on point, easy to follow, and links to tutorials are helpful for new people.

I would modify the prerequisites because client-side development with Cypress would require only npm.
I also added a comment to the server section to mention user tokens -- you said it might require more extensive changes, but it seems already good to me!

README.md Outdated
Comment on lines 22 to 35
# Prerequisites

To develop on this codebase, you will want the following tools installed.


| | |
|----------------------------------------------------------------------|---------------------------------------------------------------------|
| [docker](https://www.docker.com) | For building containers |
| [helm](https://helm.sh) | For packaging things for K8s |
| [kubectl](https://kubernetes.io/docs/tasks/tools/) | K8s command-line tool |
| [nvm](https://github.com/nvm-sh/nvm) | NVM or some similar tool for managing node environments |
| [telepresence](https://www.telepresence.io/docs/latest/quick-start/) | Tool for redirecting requests to your local development environment |

You should use your **node version manager** to install the node version specified in the [Dockerfile](https://github.com/SwissDataScienceCenter/renku-ui/blob/master/client/Dockerfile).
Copy link
Member

Choose a reason for hiding this comment

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

Most of these tools are not required for developing with Cypress on the client. And I believe helm is not needed in most cases, just for deploying to an own namespace but not for interacting with CI deployments.
Should we rephrase to indicate that npm is always necessary, and docker+kubectl are required for telepresence?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion, I have split up the prerequisites into three sections -- always needed, needed for telepresence, and needed to deploy to K8s.

README.md Outdated

# Server

The server is the [Express-based](https://expressjs.com) back-end for the RenkuLab UI. At first, the front-end would interact directly with back-end services, but this structure imposed some limitations and complications, so we introduced a server component with the sole responsibility of serving the UI and simplifying interactions with the other backend services.
Copy link
Member

Choose a reason for hiding this comment

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

I would remove the historical reasons for creating the server, and mention that it also handles requesting, storing, and renewing user tokens because it's safer than doing it in the client and it allows us to poll some resources on behalf of the user

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I have made these changes.


The instructions for deploying the renku application into K8s are the same as in the client, so see that section for those details. There are some small differences in how the server `run-telepresence.sh` script works compared to the client.

* In the server, `run-telepresence.sh` will prompt you to provide or override the deployment you want to intercept. You can enter the id of a PR to intercept the deployment associated with a GitHub PR.
Copy link
Member

Choose a reason for hiding this comment

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

I'm tempted to adjust the 2 telepresence scripts to unify this behavior.
If it's ok with you, once the PR is ready I would add a commit to align it (and update this section accordingly) .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In general, I'm ok with that change, but I think it would be nicer if the prompting only happened if no values were provided. That is, if there is no DEV_NAMESPACE or PR environment variable set, then prompt for it, but one of them is set, do not prompt and just use what was provided.

Copy link
Member

Choose a reason for hiding this comment

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

Good suggestion! I will go that way 👍

Copy link
Contributor

@andre-code andre-code left a comment

Choose a reason for hiding this comment

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

Great documentation 👏 I find the added information very clear and useful.

In addition, have you considered including a Support/Troubleshooting section for common errors for example when we are working with telepresence and have to deal with dropping connections.
Should the Administrator's Guide work for all external contributions or do they need additional permissions?

@ciyer
Copy link
Contributor Author

ciyer commented Jan 6, 2023

In addition, have you considered including a Support/Troubleshooting section for common errors for example when we are working with telepresence and have to deal with dropping connections.

Good point! I added a section about fixing telepresence problems. Is there anything else that you think should be in there?

Should the Administrator's Guide work for all external contributions or do they need additional permissions?

My understanding is that if you have access to a K8s cluster and have sufficient permissions, you should be able to deploy the renku app using the instructions there. External contributors will need to organize their own K8s cluster, though, since they will not have access to ours.

Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi left a comment

Choose a reason for hiding this comment

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

Lgtm! 🚀

I will open another PR later to unify the behavior for telepresence

@ciyer ciyer merged commit 29b871a into master Jan 9, 2023
@ciyer ciyer deleted the 2165-dev-docs branch January 9, 2023 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start documenting UI best practices
4 participants