Skip to content

son‐workspace

José Bonnet edited this page Sep 7, 2017 · 2 revisions

The son-workspace tool plays two major roles:

  1. to create and manage a development workspace/environment;
  2. to create projects.

A workspace contains a user-specific configuration which can be used for the creation and maintenance of multiple projects.

Workflow

The current usage of all these tools follow a simple workflow that start with the creation of a workspace. In order to do that, the developer should invoke the son-workspace tool with the --init option. The developer should then check the created files and edit them where needed, as the workspace contains personal configurations. The next step is to create a project. In order to do so the developer should invoke the son-workspace tool with the --project option.

Configuration

The workspace configuration keeps distinct information often related with the other CLI tools. The following code shows the default configuration after the creation of a new workspace:

default_descriptor_extension: yml
default_service_platform: sp1
log_level: INFO
name: SONATA Workspace
platforms_dir: platforms
projects_dir: projects
schemas_local_master: /home/user/.son-schema
schemas_remote_master: https://raw.githubusercontent.com/sonata-nfv/son-schema/master/
service_platforms:
  sp1:
    credentials:
      password: s0n@t@
      signature:
        cert: ''
        prv_key: ''
        pub_key: ''
      token_file: token.txt
      username: sonata
    url: http://sp.int3.sonata-nfv.eu:32001
validate_watchers:
  test/projects:
    integrity: true
    syntax: true
    topology: true
    type: project
version: '0.05'

For instance, the service_platforms configuration tree will be used by the son-access tool for defining authentication parameters in a particular Service Platform. Another example are the schemas_local_master, schemas_remote_master and validate_watchers configurations, used by the son-validate tool to specify the location of the descriptor schemas and projects which will be monitored. A comprehensive description of these configuration can be found in the documentation of the respective tool.

Usage

usage: son-workspace [-h] [--init] [--workspace WORKSPACE] [--project PROJECT]
                     [--debug]

Generate new sonata workspaces and project layouts

optional arguments:
  -h, --help            show this help message and exit
  
  --init                Create a new sonata workspace
  
  --workspace WORKSPACE
                        location of existing (or new) workspace. If not
                        specified will assume '$HOME/.son-workspace'
                        
  --project PROJECT     create a new project at the specified location
  
  --debug               increases logging level to debug

Example on how to create an workspace and a project:

	son-workspace --init --workspace /home/user/workspaces/ws1
	son-workspace --workspace /home/user/workspace/ws1 --project /home/user/workspace/ws1/projects/p1

This example creates the workspace ws1 and a project p1 associated with it.