Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

These instructions have been verified on OSX High Sierra 10.13.4 using Docker for Mac Version 18.05.0-ce-rc1-mac63 (24246), which is latest edge version, stable channel will work as well.

...

  1. Recent Docker for Mac (tested with latest edge and stable release)
  2. Docker for Mac has to be sized to allow running all SDC containers, see instructions.
  3. Code changes from: https://gerrit.onap.org/r/#/c/45921/
  4. Basic development utils for building the source code (Git, java, maven etc..)


Instructions:

Make sure your docker is up and running, and is fully updated. Once docker is up and running (you can pull images and run them, ie docker pull ubuntu && docker run -it ubuntu /bin/bash), set resources for docker to something like this(these work on my MacBook Pro 15 Retina):

...

Save settings and restart docker.

These instructions assume, you have installed git, java, maven etc.. on your OSX. Installing these basic development tools are out of scope of these instructions.

  1. Clone the SDC project, and run: mvn clean install -Pdocker
  2. Once this completes (and it will take a while since everything will be built), create new folder called data in SDC project directory, and add it to .gitignore, since we dont want to commit this ever.
  3. Export variable WORKSPACE=$(pwd) where in this case, $(pwd) is SDC project root, so change directory to SDC project root, and run: export WORKSPACE=$(pwd)
  4. Follow instructions 1,2 and 3 from Deploying SDC on a Linux VM for Development section Initial Setup, placing files in above created data directory
  5. In above mentioned file AUTO.json, update yyy with IP adress of your mac (usually en0 interface)

Running containers:

...

Building the source code

Change directory to SDC project and run:

Code Block
languagebash
titleBuilding source code
mvn clean install -Pdocker

This will build entire project and all docker containers. Note that this might take a while.

Preparing the configuration files

These instructions are taken from: Deploying SDC on a Linux VM for Development and slightly modified to facilitate for OSX specifics.

  1. Inside SDC project, create new folder calleddata
  2. Add above project to gitignore, as we don't want this to be included with any commits.
  3. Inside data directory, do following:
    1. create opt/config/ 
    2. place the following files in this /opt/config/ folder:

    3. Image Addednexus_username.txtImage Addedenv_name.txtImage Addednexus_docker_repo.txtImage Addednexus_password.
    4. Inside data directory, create environments directory 
    5. Copy the file from here: https://git.onap.org/sdc/tree/sdc-os-chef/environments/Template.json into data/environments/AUTO.json
    6. Edit AUTO.json file, replace yyy with your en0 IP address (your laptop's IP address), and update name and description xxx with AUTO

Example file looks like this after editing:

Code Block
titleAUTO.json
{
  "name": "AUTO",
  "description": "OpenSource-AUTO",
  "cookbook_versions": {
    "Deploy-SDandC": "= 1.0.0"
  },
  "json_class": "Chef::Environment",
  "chef_type": "environment",

  "default_attributes": {
    "disableHttp": false,
    "CS_VIP": "159.107.152.117",
    "BE_VIP": "159.107.152.117",
    "ONBOARDING_BE_VIP": "159.107.152.117",
    "FE_VIP": "159.107.152.117",
    "ES_VIP": "159.107.152.117",
    "KB_VIP": "159.107.152.117",
    "DCAE_BE_VIP": "159.107.152.117",
    "DCAE_FE_VIP": "159.107.152.117",
    "interfaces": {
      "application": "eth0",
      "private": "eth1"
    },
    "ECompP": {
      "ecomp_rest_url": "http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/auxapi",
      "ueb_url_list": "10.0.11.1,10.0.11.1",
      "app_secret": "XftIATw9Jr3VzAcPqt3NnJOu",
      "app_key": "x9UfO7JsDn8BESVX",
      "inbox_name": "ECOMP-PORTAL-INBOX",
      "ecomp_redirect_url": "http://portal.api.simpledemo.openecomp.org:8989/ECOMPPORTAL/login.htm",
      "app_topic_name": "ECOMP-PORTAL-OUTBOX-SDC1",
      "decryption_key": "AGLDdG4D04BKm2IxIWEr8o=="
    },
    "UEB": {
      "PublicKey": "iPIxkpAMI8qTcQj8",
      "SecretKey": "Ehq3WyT4bkif4zwgEbvshGal",
      "fqdn": ["10.0.11.1", "10.0.11.1"]
    },
    "Nodes": {
      "CS": [
        "159.107.152.117"
      ],
      "BE":            "159.107.152.117",
      "ONBOARDING_BE": "159.107.152.117",
      "FE":            "159.107.152.117",
      "ES": [
        "159.107.152.117"
      ],
      "KB":            "159.107.152.117"
    },
    "Plugins": {
      "DCAE": {
        "dcae_discovery_url": "159.107.152.117",
        "dcae_source_url": "159.107.152.117"
      },
      "WORKFLOW": {
        "workflow_discovery_url": "159.107.152.117",
        "workflow_source_url": "159.107.152.117"
      }
    },
    "VnfRepo": {
      "vnfRepoPort": "8702",
      "vnfRepoHost": "192.168.50.5"
    }
  },
  "override_attributes": {
    "FE": {
      "http_port": "8181",
      "https_port": "9443"
    },
    "BE": {
      "http_port": "8080",
      "https_port": "8443"
    },
    "ONBOARDING_BE": {
      "http_port": "8081",
      "https_port": "8445"
    },
    "elasticsearch": {
      "cluster_name": "SDC-ES-",
      "ES_path_home": "/usr/share/elasticsearch",
      "ES_path_data": "/usr/share/elasticsearch/data",
      "num_of_replicas": "0",
      "num_of_shards": "1"
    },

    "cassandra": {
      "concurrent_reads": "32",
      "num_tokens": "256",
      "data_dir": "/var/lib/cassandra/data",
      "hinted_handoff_enabled": "true",
      "cassandra_user": "asdc_user",
      "cassandra_password": "Aa1234%^!",
      "concurrent_writes": "32",
      "cluster_name": "SDC-CS-",
      "multithreaded_compaction": "false",
      "cache_dir": "/var/lib/cassandra/saved_caches",
      "log_file": "/var/lib/cassandra/log/system.log",
      "phi_convict_threshold": "8",
      "commitlog_dir": "/var/lib/cassandra/commitlog",
      "socket_read_timeout": "20000",
      "socket_connect_timeout": "20000",
      "titan_connection_timeout": "10000"
    }
  }
}


Running containers:

Change directory to SDC project and export WORKSPACE env variable:

Code Block
languagebash
titleWORKSPACE ENV VAR
export WORKSPACE=$(pwd)

and you can start locally built containers now with:

Code Block
languagebash
titleRunning SDC containers
sdc-os-chef/scripts/docker_run.sh -e AUTO -l

After It takes a while to start them all and init cassandra, elastic and import normatives, but after sometime you should have:

Image Modified


All containers will be exposed (as per Docker for OSX) on localhost and your machine IP (en0 interface).

...