Git Product home page Git Product logo

livecycle / preevy Goto Github PK

View Code? Open in Web Editor NEW
2.0K 2.0K 77.0 24.22 MB

Quickly deploy preview environments to the cloud!

Home Page: https://preevy.dev

License: Apache License 2.0

JavaScript 3.25% TypeScript 93.46% Batchfile 0.03% Shell 1.07% Dockerfile 0.10% Starlark 0.05% CSS 0.43% MDX 1.31% Nunjucks 0.30%
awesome awesome-list aws cli devops docker docker-compose ephemeral-environments hacktoberfest pr-environments preview-environment

preevy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

preevy's Issues

Support adding & querying metadata on environments

Can be exposed by 'compose-tunnel-agent' which might worth changing to simply Preevy agent.
Such metadata can be:

  • Time of creation
  • Provider flags (size, region)
  • Git Context
  • Current services/tunnels (already implemented partly)
  • Plugins metadata

This data can be used by Preevy widget/dashboard

[Docs]: Disable blank issues and provide a misc. template

what's wrong with the documentation?

By disabling blank issues, we will prevent issues without enough information or spammy issues.
We can add a miscellaneous template that will be used for anything else that does not fit the current templates.

If you like this idea, I'd like to work on this. ๐Ÿ™‚

Add screenshots

I don't think this applies here.

Record

  • I agree to follow this project's Code of Conduct

Basic Authn/Authz support

Initial implementation will be based on http basic authentication.

  • Support for declaring "private" services
  • Support for authentication using tunneling-key based authentication

[Improvement]:Update Package Scripts for Cross-Platform Compatibility

What feature?

Currently, some of the package scripts in our package.json files are not compatible with all operating systems. To ensure seamless development across different platforms, we need to update the scripts to be cross-platform compatible.

Affected script:
clean The current implementation uses rm -rf to remove directories, which is not compatible with Windows systems.

Describe the solution you'd like

We should switch to a cross-platform solution like rimraf.

Describe alternatives you've considered

No response

Additional context

No response

Add screenshots

No response

Record

  • I agree to follow this project's Code of Conduct

Reduce stack trace noise in errors

We should take into consideration the level of error verbosity and the type of error to remove noise from the CLI output.
For example, error in mismatching or invalid args/flags shouldn't print out a stack trace.

Implement initial support for Kubernetes as machine provider

This feature will allow users to use their existing k8s infrastructure as backbone for Preevy environments.
Initial implementation can create a pod with support for nested Docker (probably need to be privileged or require additional CRI runtime), port-forwarding can be done with kubectl.
Persistent volume might also be interesting to add in the future to support "suspending" an environment.

Tasks

Preevy widget

Initial functionality:

  • Show all services and links
  • Show current git context (branch/pr)

[BUG] - Preevy should print meaningful error if docker executable not found

Currently, preevy print this error:

Error: spawn docker ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at processTicksAndRejections (node:internal/process/task_queues:82:2

It's very aggressive and we should print a friendlier message

feat: add new issue templates

currently, we have only two issue templates we can add a few templates such as style, docs etc.

  • we need to use the .yml format issue template like these.
    image

features if we use the .yml format

  • we can add multiple textboxes, checkboxes, tags etc.
    image

I want to work on this issue

README - aws login

The main README says:
In AWS, it could be by using aws login or aws configure

the AWS cli doesn't contain any login command.

what am i missing?

Support authentication session in tunnel server

We should be able to support the session for:

  • Support flows different from basic authentication
  • Improving the experience of the login between different environments/services (no need to re-login)
  • Allow to create a session without passing the authorization header the can conflict with internal app authorization header and doesn't work properly when using websockets

[BUG]: tunnel server can produce URLs that include invalid subdomain with >63 length

Bug description?

Subdomain is limited to 63 characters, we should trim to the characters to support valid URLs.
Implementation can be done in tunnel server or Preevy/compose tunnel agent.
In both cases, we should pay attention to the CLI functionality of predicting the URL for injecting env variables:
https://preevy.dev/recipes/service-discovery

We should also think if we want to truncate the entire subdomain url, or set a size limit for each fragment:
https://{service}-{[port]}-{env-id}-{client-id}

Additional context

Current workaround: use the --id flag in up to create a shorter env identifier or use shorter branch names.

Record

  • I agree to follow this project's Code of Conduct

bug showing logs

using the CLI to show logs show no prompt.
after executing up command, trying to show logs with a wrong service name does nothing.

Steps to reproduce:

  • preevy up
  • preevy logs any-text-you-want
  • nothing happens, no error, no logs.

using debug level shows that socket is closed.

image

  • if there is no env up or after 'preevy down' command, the output is ok ( Error: No machine found for envId wekan-master)

Preevy deployment with Google cloud

Currently, if you'll try to deploy with the GCP driver while your branch name contains Uppercase characters, you'll get the following error

Run echo "/home/runner/work/_actions/livecycle/preevy-up-action/v1.2.0" >> $GITHUB_PATH
Run # Convert the docker-compose-yaml-paths input to an env var
Docker file paths docker-compose.yml
Running Preevy with files: -f docker-compose.yml -f docker-compose.dev.yml 
Using environment ID: preevy-saas-eliyaenvironmentsUI
- Creating Google Cloud machine
โœ– Creating Google Cloud machine: Creating from existing snapshot
    Error: Invalid value for field 'resource.labels': ''. Label value 
    'preevy-saas-eliyaenvironmentsUI' violates format constraints. The value 
    can only contain lowercase letters, numeric characters, underscores and 
    dashes. The value can be at most 63 characters long. International 
    characters are allowed.
    Code: 3

Possible solution: lowercase the resource label value.

Add first class support for TLS in tunnel server

At present, Preevy tunnel only forwards HTTP traffic, and HTTPS is handled by an external service that performs TLS termination. The tunnel server uses the HTTP host header to route traffic to the appropriate service.

If TLS support is added to the tunnel server, Preevy will be able to route non-HTTP traffic to the correct host using Server Name Indication (SNI). Specific protocol manipulation, such as rewriting headers, can be accomplished by explicitly specifying the channel type or using Application-Layer Protocol Negotiation (ALPN).

This new feature will enable users to directly connect to their non-HTTP services, such as databases, provided that their client supports TLS and uses SNI.

Suggestion: Create Action to ease the use of Preevy in GH actions

Is your feature request related to a problem? Please describe.
An easy way to set up Preevy up/down flows in GH actions.
Currently, it requires installing Preevy with npm -g or using npx.

Describe the solution you'd like
A GH action that wrap the up/down parameters.
Profile is specified as parameter and importing is done automatically.

uses: preevy/action@v1
with:
     profile-url: "s3://aabcd"
     command: up
     args: 

Describe alternatives you've considered
It's possible to remove NPM dependency/installation by packing Preevy CLI as a Docker image, and support environment variable for profile URL, but there's a drawback which it's not trivial to get the cloud provider context when running this way.

rename 'envId' to 'environment id'

when using preevy up, the following text appears:
'Using envId: xxx'
replace it with something more readable like
'Using environment id: xxx'

Add environment variables for tunnel-server urls for usage in docker-compose

When doing service-service communication, Preevy can work well due to compose service discovery.
However, when using a frontend that utilize the exposed port for connecting to backend (can be common in dev environments), it's a bit tricky since we need to replace the url with tunneling url which we don't know about yet.

One way to solve it, is by injecting/resolving env variables of tunneling url in compose normalization. (so it can affect both build args, and environment)

For example:

services:
     api:
           ....
           ports:
           - 9005:3000
     fronend:
          environment:
          - API_URL=http://localhost:9005

This could be a common setup.

With Preevy, it could be something like:

services:
     api:
           ....
           ports:
           - 9005:3000
     fronend:
          environment:
          - API_URL={PREEVY_BASE_URI_API_3000:-http://localhost:9005}

In the future, we can enhance this by supporting inference of this configuration automatically and replacing all static http://localhost:xx variables' values based on public ports definitions.

Add a "troubleshooting" section

For example, use ssh to go into the VM and use the internal docker commands to find out what's wrong

  • Cover debug with preevy ssh
  • Cover authorization scenarios for frontend apps (domain origin in such)

[Improvement]: Add messaging for initial CLI cloud interactions

What feature?

When using preevy up or other commands, it can take several seconds until we see the output due to connectivity with cloud providers. (for example, downloading profile)
We can improve this experience by adding console messages that log these interactions.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Add screenshots

No response

Record

  • I agree to follow this project's Code of Conduct

Package/Component renaming

Current package names are a bit confusing, suggestion:
standalone-proxy -> tunneling, or tunneling-service is more fitting to the context.
docker-proxy -> compose-tunneling-agent or docker-tunneling-agent as it basically a client daemon that connect to a tunneling service based on compse/docker state

Add Preevy link in Pull Requests

Add a simple way to get to the latest Preevy environment of a PR, ideally using a Preevy bot adding the link as a comment in the PR

Implement store based on Azure blob storage for profile store

Implement a profile storage for azure blob storage.

Should be similar to other implementations:

Registration is done here:
https://github.com/livecycle/preevy/blob/main/packages/cli/src/fs.ts

Url format should follow conventions of golang cloud sdk:
https://gocloud.dev/howto/blob/#azure

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.