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

[ENH] - Create a Nebari Makefile for Local deployment and CI #2489

Open
7 tasks
viniciusdc opened this issue May 28, 2024 · 8 comments · May be fixed by #2554
Open
7 tasks

[ENH] - Create a Nebari Makefile for Local deployment and CI #2489

viniciusdc opened this issue May 28, 2024 · 8 comments · May be fixed by #2554
Assignees
Labels
area: testing ✅ Testing good first issue Good for newcomers status: in progress 🏗 This task is currently being worked on

Comments

@viniciusdc
Copy link
Contributor

viniciusdc commented May 28, 2024

Feature description

Currently, our Cypress and Playwright installations rely on GitHub Actions. Transitioning these installation workflows to a Makefile could alleviate some of the maintainers' burdens by simplifying the process of running tests locally. This move would streamline testing and potentially improve efficiency.

Value and/or benefit

  • Better docs on this approach
  • More control on tracking testing versions
  • More testing

Anything else?

No response

Tasks

@viniciusdc viniciusdc added good first issue Good for newcomers area: testing ✅ Testing labels May 28, 2024
@pt247
Copy link
Contributor

pt247 commented May 29, 2024

To ensure that the Makefile is always up-to-date, @dcmcand suggested using it in CI. Creating Makefile with steps followed in .github/workflows/test_local_integration.yaml would be an excellent place to start.
We can initially introduce the following make commands:

  1. make init: This defaults to local deployment.
    a. If the OS is Mac, it verifies that the docker-mac-net-connect service is running.
    b. Install Nebari and playwright - link.
    c. Initilizes Nebari like in CI for local deployment link
  2. make deploy:
    a. Deploy Nebari link.
    b. Basic kubectl checks after deployment - link.
    c. Check nebari url resolves - like.
    d. Curl jupyterhub login page - link
    e. Create example-user - link.
  3. make test:
    a. setup-node - link
    b. make run-cypress-tests - link.
    c. make run-playwright-tests link.
    d. make run-unit-tests link.
  4. make clean:
    a. Cleanup nebari deployment - link.
    b. kind delete clusters test-cluster

In later PRs, we can extend the same for other providers like GCP, DO, and AWS. For example:
make init --provider=AWS
Other commands can remain the same, except they will run against cloud instances determined by local environment variables. This should let us run cloud-based integration tests.

@viniciusdc
Copy link
Contributor Author

good point, @pt247; I was only considering including the playwright/cypress installation and test execution commands. But its a really neat idea to also incorporate the deploy/init structures.

@pt247
Copy link
Contributor

pt247 commented May 29, 2024

Let's use this issue as a super issue to track progress on Nebari Makefile sub-issues/tasks.
Renaming the issue to Nebari Makefile.

@pt247 pt247 changed the title [ENH] - Create a Makefile for Cypress/Playwright execution workflow instructions [ENH] - Create a Nebari Makefile May 29, 2024
@pt247 pt247 changed the title [ENH] - Create a Nebari Makefile [ENH] - Create a Nebari Makefile for Local deployment and CI May 29, 2024
@pt247 pt247 self-assigned this May 29, 2024
@viniciusdc
Copy link
Contributor Author

Thanks @pt247, I was about to assign you to this as well 😄

@viniciusdc viniciusdc added the status: in progress 🏗 This task is currently being worked on label May 30, 2024
@viniciusdc viniciusdc added this to the Nebari Core Team - Testing milestone May 30, 2024
@pt247
Copy link
Contributor

pt247 commented Jun 21, 2024

Update: The following Git Gist contains the Makefile and the Nebari config I am using to create the Nebari cluster locally.

https://gist.github.com/pt247/b17e3bec1dd25421082d109328a938b4

@pt247
Copy link
Contributor

pt247 commented Jun 22, 2024

Update

With the above git gist, we can now spin up a local cluster for testing using the Makefile.
It still uses Cloudflare for the DNS-01 challenge so that Letsencrypt can generate trusted certificates.

The main issue with this setup is that it needs Cloudflare setup for usable certificates.

There are requirements:

  1. UI: Ability to log in and create environments and notebooks. (<-- this needs certificates)
  2. Run integration tests locally. (<-- this does not need certificates)

Some links worth exploring to find alternatives for Cloudflare:

  1. https://cert-manager.io/docs/configuration/selfsigned/
  2. https://skarlso.github.io/2023/10/25/self-signed-locally-trusted-certificates-with-cert-manager/

@pt247
Copy link
Contributor

pt247 commented Jun 22, 2024

Limiting the scope of this ticket

We should focus on local certificates while we are working on #2238.
In this ticket, we will focus on replace CI tests in Makefile.

@pt247
Copy link
Contributor

pt247 commented Jun 25, 2024

Updated gist with the latest Makefile with playwright tests.

@pt247 pt247 linked a pull request Jul 3, 2024 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: testing ✅ Testing good first issue Good for newcomers status: in progress 🏗 This task is currently being worked on
Projects
Status: New 🚦
Development

Successfully merging a pull request may close this issue.

2 participants