What's on this page

Setting up a project

The first step in developing a Network Service (NS) is to create a NS project.

Create NS Project

On your local environment, you create a NS project by running the following LMCTL command in the folder you want the NS to be created in:

lmctl project create --name myvns --version 0.1 --servicetype NS ./myns

This creates a NS directory structure for the NS. The result of this is a NS directory structure that is created that should look like this:

├── Descriptor
│   └── assembly.yml
├── Behaviour
│   └── Runtime
│   └── Templates
│   └── Tests
└── lmproject.yml

Project structure explanation

Directory structure

A top level project structure can have the following artifacts:

DirectoryRequiredDescription
DescriptorYesThis directory must contain a descriptor file called “assembly.yml”, representing the top level Network Service. The descriptor is pushed to TNC-O during onboarding
BehaviouroptionalThis optional directory contains the Assembly Templates and Scenarios used by the test scenarios
Behaviour/TestsoptionalThis optional directory contains the Test Scenarios. These are pushed to TNC-O automatically during on boarding
Behaviour/TemplatesoptionalThis optional directory contains the Assembly Templates. These are pushed to TNC-O automatically during onboarding
Behaviour/RuntimeoptionalThis optional directory contains the Runtime Scenarios, such as Diagnostic tests. These are pushed to TNC-O automatically during on boarding

lmproject File

Every project should include a lmproject.yml file at root that is automatically created when you create the project using LMCTL. This file will be automatically updated once you add elements and VNFs to the NS in the Designer, so there is no manual action needed for the NS lmproject.yml file.

Commit, Create and Push Project to GIT

Commit the project

  $ cd ./myvns
  $ git init
  $ echo "_lmctl"  > .gitignore
  $ git add .
  $ git commit -m 'initial project'

Create the project on Git Server (Gogs)

Go to Gogs in the CI/CD hub.

Push project to Gogs

On your local machine:

  $ git remote add origin http://<gogs ip address>:8001/cicdhub-admin/myvns.git
  $ git push -u origin master

Create git develop branch

  $ git checkout -b develop

Push Project to Dev Environment

The NS project needs to be pushed to the development environment. Run the following command in the project directory (assuming “dev” is the name of the environment you want to push the NS to):

  $ cd <myvns dir>
  $ lmctl project push dev

When you login to TNC-O and go to the Assembly Designer section, you should see an assembly with the project name you created.