jupyter-naas/naas

Add a naas.service.add function

Dr0p42 opened this issue · 0 comments

Dr0p42 commented

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:

  • Create a new Docker registry on service.naas.ai
  • Create a new service on service.naas.ai
  • Generate CI/CD for github.

Estimate: 3
Priority: low