jupyter-naas / naas

Low-code Python library to safely use notebooks in production: schedule workflows, generate assets, trigger webhooks, send notifications, build pipelines, manage secrets (Cloud-only)
https://app.naas.ai/
GNU Affero General Public License v3.0
282 stars 25 forks source link

Add a naas.service.add function #392

Closed Dr0p42 closed 1 year ago

Dr0p42 commented 1 year ago

We need to implement a naas.service.add function making it possible to create a new service.

The specifications are:

naas.service.add(
  service_name="my-data-product",
  service_type="docker",  
  dockerfile_path="Dockerfile",
  docker_context=".",
  container_port="8080",
  generate_ci=True, 
  ci_type="github-actions", 
  cpu=None,
  memory=None
) 

All values should be default, only the service_name should be required.

service_name: The name the user wants to give to the service. service_type: The type of service to create. This is mainly to make it easier for the user in the case it's not of type docker. We can provide default Dockerfiles etc if needed. dockerfile_path: The path where the Dockerfile is in the project. Starting from the root folder. docker_context: From which folder we should build the container. container_port: On which port the container will listen once started. This should be used to configure the Knative service. generate_ci: Wether we should generate the CI/CD configuration for the user. ci_type: The type of CI to which we want to generate the configuration for. cpu: The cpu request for the container to run. memory: The memory request for the container to run.

This is a low code formula that should take advantage of other already existing functions allowing to do the following:

Estimate: 3 Priority: low