[CORD-2276]
Update xos-base to 16.04, remove unused/legacy packages

Change-Id: Ie60c74bc171c3c1e55d53877e8a9b8cca0f0db27
diff --git a/containers/chameleon/Dockerfile.chameleon b/containers/chameleon/Dockerfile.chameleon
index 7d69ed8..2fc9937 100644
--- a/containers/chameleon/Dockerfile.chameleon
+++ b/containers/chameleon/Dockerfile.chameleon
@@ -25,7 +25,9 @@
 COPY tmp.chameleon /chameleon/chameleon
 
 # Build the protos
-RUN chdir chameleon/chameleon/protos && VOLTHA_BASE=anything make
+RUN pip install docker==3.1.4 klein==17.10.0 fluent-logger==0.9.2 \
+ && chdir chameleon/chameleon/protos \
+ && VOLTHA_BASE=anything make
 
 # Label image
 ARG org_label_schema_schema_version=1.0
diff --git a/containers/xos/Dockerfile.base b/containers/xos/Dockerfile.base
index d94e4db..19359f7 100644
--- a/containers/xos/Dockerfile.base
+++ b/containers/xos/Dockerfile.base
@@ -1,4 +1,3 @@
-
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,49 +12,26 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 # Dockerfile.base
 # This image isn't used, but installs the prereqs for the other XOS images
-FROM ubuntu:14.04.5
+FROM ubuntu:16.04
 
 # Install apt packages, including docker
-RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y \
     apt-transport-https \
+    build-essential \
     curl \
-    cython \
-    gcc \
-    geoip-database \
-    git \
-    graphviz \
-    graphviz-dev \
-    libcurl4-gnutls-dev \
-    libffi-dev \
-    libgeoip1 \
     libpq-dev \
-    libxslt1-dev \
-    libxslt1.1 \
     libyaml-dev \
-    m4 \
     openssh-client \
-    pkg-config \
-    python-dev \
     python-pip \
-    rsync \
     software-properties-common \
     sshpass \
-    supervisor \
-    unzip \
-    wget \
- && apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 \
-    --recv-keys 58118E89F3A912897C070ADBF76221572C52609D \
- && echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | \
-    tee /etc/apt/sources.list.d/docker.list \
  && apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 \
     --recv-keys 46095ACC8548582C1A2699A9D27D666CD88E42B4 \
  && echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | \
     tee -a /etc/apt/sources.list.d/elastic-6.x.list \
  && apt-get update \
- && apt-get install -y docker-engine \
  && apt-get install -y filebeat \
  && update-rc.d filebeat defaults 95 10 \
  && rm -rf /var/lib/apt/lists/* \
@@ -66,11 +42,13 @@
 COPY filebeat.yml /etc/filebeat/filebeat.yml
 
 # Install python packages with pip
+# Upgrade methodology - pip_requested.txt is the manually generated list of pip
+# packages desired, without any added dependencies. It is used to generate
+# pip_requirements.txt by running: pip install -r pip_requested.txt then use
+# `pipdeptree` to make sure dependencies aren't broken, then
+# `pip freeze > pip_requirements.txt` and manually clean up.
 COPY pip_requirements.txt /tmp/pip_requirements.txt
-
-# Upgrade requests from apt installed version
-RUN pip install --no-deps -U -I requests==2.11.1 \
- && pip install --no-deps -U -I pip==9.0.1 setuptools==36.0.1 \
+RUN pip install --no-deps -U -I pip==9.0.3 setuptools==39.0.1 requests==2.18.4 \
  && pip install --no-deps -r /tmp/pip_requirements.txt \
  && pip freeze > /var/xos/pip_freeze_pip_up_`date -u +%Y%m%dT%H%M%S`
 
diff --git a/containers/xos/Dockerfile.xos-core b/containers/xos/Dockerfile.xos-core
index c43853e..1c6ce85 100644
--- a/containers/xos/Dockerfile.xos-core
+++ b/containers/xos/Dockerfile.xos-core
@@ -1,4 +1,3 @@
-
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,7 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 # xosproject/xos-core
 FROM xosproject/xos-libraries:candidate
 
@@ -21,14 +19,13 @@
 ADD xos /opt/xos
 ADD lib /opt/xos/lib
 
-RUN chmod +x /opt/xos/tools/xos-manage \
- && mkdir -p /opt/cord_profile /opt/xos_services /opt/xos_libraries \
- && sync \
- && /opt/xos/tools/xos-manage genkeys
-
-RUN xosgenx --output /opt/xos/core/models --target django.xtarget --dest-extension py --write-to-file model /opt/xos/core/models/core.xproto
-RUN xosgenx --output /opt/xos/core/models --target django-security.xtarget --dest-file security.py --write-to-file single /opt/xos/core/models/core.xproto
-RUN xosgenx --output /opt/xos/core/models --target init.xtarget --dest-file __init__.py --write-to-file single /opt/xos/core/models/core.xproto
+RUN mkdir -p /opt/cord_profile /opt/xos_services /opt/xos_libraries \
+ && xosgenx --output /opt/xos/core/models --target django.xtarget --dest-extension py \
+      --write-to-file model /opt/xos/core/models/core.xproto \
+ && xosgenx --output /opt/xos/core/models --target django-security.xtarget --dest-file security.py \
+      --write-to-file single /opt/xos/core/models/core.xproto \
+ && xosgenx --output /opt/xos/core/models --target init.xtarget --dest-file __init__.py \
+      --write-to-file single /opt/xos/core/models/core.xproto
 
 # Set environment variables
 ENV HOME /root
diff --git a/containers/xos/pip_requested.txt b/containers/xos/pip_requested.txt
new file mode 100644
index 0000000..ddb2e1a
--- /dev/null
+++ b/containers/xos/pip_requested.txt
@@ -0,0 +1,49 @@
+Django==1.11.11
+Jinja2==2.10
+Pattern==2.6
+PyYAML==3.12
+Twisted==16.6.0
+Werkzeug==0.14.1
+ansible==2.5.0
+astunparse==1.5.0
+django-extensions==2.0.6
+django-timezones==0.2
+djangorestframework==3.7.7
+dnspython==1.15.0
+functools32==3.2.3-2
+futures==3.2.0
+google-api-python-client==1.6.5
+grpcio-tools==1.9.1
+grpcio==1.9.1
+keystoneauth1==3.4.0
+mock==2.0.0
+multistructlog==1.5
+netaddr==0.7.19
+networkx==1.11
+nose==1.3.7
+oslo.log==3.37.0
+oslo.messaging==5.36.0
+oslo.serialization==2.25.0
+oslo.utils==3.36.0
+ply==3.11
+plyxproto==3.0.1
+protobuf==3.5.2
+# Avoids a warning, see http://initd.org/psycopg/docs/faq.html#faq-compile
+psycopg2==2.7.4 --no-binary psycopg2
+pyOpenSSL==17.5.0
+pykwalify==1.6.1
+python-consul==0.7.2
+python-glanceclient==2.9.1
+python-keystoneclient==3.15.0
+python-logstash==0.4.6
+python-neutronclient==5.1.0
+python-novaclient==10.1.0
+python-openstackclient==3.14.0
+pytz==2018.3
+redis==2.10.6
+requests==2.18.4
+service-identity==17.0.0
+shade==1.27.1
+six==1.11.0
+structlog==18.1.0
+tosca-parser==0.9.0
diff --git a/containers/xos/pip_requirements.txt b/containers/xos/pip_requirements.txt
index 3e9b703..9ebf227 100644
--- a/containers/xos/pip_requirements.txt
+++ b/containers/xos/pip_requirements.txt
@@ -1,168 +1,141 @@
-pytz==2018.3
-sphinx==1.3.1
-Babel==2.3.4
-Django==1.11.10
-Jinja2==2.9.6
-Markdown==2.6.8
+Babel==2.5.3
+Django==1.11.11
+Jinja2==2.10
 MarkupSafe==1.0
 Paste==2.0.3
 PasteDeploy==1.5.2
+Pattern==2.6
+PyNaCl==1.2.1
 PyYAML==3.12
-Routes==2.3.1
-WebOb==1.6.1
-amqp==1.4.9
-attrs==17.2.0
-ansible==2.2.2.0
-anyjson==0.3.3
-appdirs==1.4.0
-asn1crypto==0.22.0
-backports.ssl-match-hostname==3.5.0.1
-ca-certs-locater==1.0
-cachetools==1.1.6
-cached-property==1.3.0
-cffi==1.10.0
-cliff==2.2.0
-cmd2==0.6.8
+Routes==2.4.1
+Twisted==16.6.0
+WebOb==1.7.4
+Werkzeug==0.14.1
+amqp==2.2.2
+ansible==2.5.0
+appdirs==1.4.3
+asn1crypto==0.24.0
+astunparse==1.5.0
+attrs==17.4.0
+bcrypt==3.1.4
+cachetools==2.0.1
+certifi==2018.1.18
+cffi==1.11.5
+chardet==3.0.4
+cliff==2.11.0
+cmd2==0.8.2
 colorama==0.3.9
 constantly==15.1.0
-contextlib2==0.5.4
-coreapi==1.32.3
-coverage==4.4.1
-cryptography==1.9
-debtcollector==1.8.0
-decorator==4.1.2
-django-extensions==1.9.9
-django-filter==1.1.0
-django-ipware==2.0.1
+contextlib2==0.5.5
+cryptography==2.2.2
+debtcollector==1.19.0
+decorator==4.2.1
+deprecation==2.0
+django-extensions==2.0.6
 django-timezones==0.2
 djangorestframework==3.7.7
-dnslib==0.9.6
-docutils==0.13.1
-docker==3.1.4
-docker_pycreds==0.2.1
+dnspython==1.15.0
 docopt==0.6.2
-dogpile.cache==0.6.2
+dogpile.cache==0.6.5
+enum-compat==0.0.2
 enum34==1.1.6
-eventlet==0.19.0
+eventlet==0.20.0
 fasteners==0.14.1
 funcsigs==1.0.2
 functools32==3.2.3-2
-futures==3.0.5
-futurist==0.18.0
-google-api-python-client==1.5.3
-greenlet==0.4.10
-sphinx_rtd_theme==0.1.9
-grpcio==1.9.1
+futures==3.2.0
+futurist==1.6.0
+google-api-python-client==1.6.5
+greenlet==0.4.13
 grpcio-tools==1.9.1
-html5lib==0.999
-httplib2==0.9.2
-idna==2.1
-ipaddress==1.0.16
-incremental==16.10.1
-iso8601==0.1.11
-itypes==1.1.0
-fluent-logger==0.9.2
-jsonpatch==1.14
-jsonpointer==1.10
-jsonschema==2.5.1
-keystoneauth1==2.12.1
-klein==17.10.0
-kombu==3.0.35
-lxml==3.6.4
-meld3==0.6.10
+grpcio==1.9.1
+httplib2==0.11.1
+idna==2.6
+incremental==17.5.0
+ipaddress==1.0.19
+iso8601==0.1.12
+jmespath==0.9.3
+jsonpatch==1.21
+jsonpointer==2.0
+jsonschema==2.6.0
+keystoneauth1==3.4.0
+kombu==4.1.0
 mock==2.0.0
-monotonic==1.2
-msgpack-python==0.4.8
+monotonic==1.4
+msgpack==0.5.6
 multistructlog==1.5
+munch==2.2.0
+netaddr==0.7.19
+netifaces==0.10.6
 networkx==1.11
-numpy==1.13.1
-munch==2.0.4
-ndg-httpsclient==0.4.2
-netaddr==0.7.18
-netifaces==0.10.5
 nose==1.3.7
-oauth2client==3.0.0
-openapi-codec==1.0.0
-openstacksdk==0.9.4
-os-client-config==1.21.0
-osc-lib==1.1.0
-oslo.concurrency==3.14.0
-oslo.config==3.17.0
-oslo.context==2.9.0
-oslo.i18n==3.9.0
-oslo.log==3.16.0
-oslo.messaging==5.10.0
-oslo.middleware==3.19.0
-oslo.serialization==2.13.0
-oslo.service==1.16.0
-oslo.utils==3.16.0
-osprofiler==1.4.0
-paramiko==2.0.2
-pattern==2.6
-pbr==1.10.0
-pika==0.10.0
+oauth2client==4.1.2
+openstacksdk==0.12.0
+os-client-config==1.29.0
+os-service-types==1.2.0
+osc-lib==1.10.0
+oslo.concurrency==3.26.0
+oslo.config==6.0.0
+oslo.context==2.20.0
+oslo.i18n==3.20.0
+oslo.log==3.37.0
+oslo.messaging==5.36.0
+oslo.middleware==3.35.0
+oslo.serialization==2.25.0
+oslo.service==1.30.0
+oslo.utils==3.36.0
+packaging==17.1
+paramiko==2.4.1
+pbr==4.0.0
 pika-pool==0.1.3
-ply==3.10
-positional==1.1.1
+pika==0.10.0
+pipdeptree==0.11.0
+ply==3.11
+plyxproto==3.0.1
+positional==1.2.1
 prettytable==0.7.2
 protobuf==3.5.2
-psycopg2==2.6.2
-pyOpenSSL==16.2.0
-pyasn1==0.1.9
-pyasn1-modules==0.0.8
+# Avoids a warning, see http://initd.org/psycopg/docs/faq.html#faq-compile
+psycopg2==2.7.4 --no-binary psycopg2
+pyOpenSSL==17.5.0
+pyasn1-modules==0.2.1
+pyasn1==0.4.2
 pycparser==2.18
-pycrypto==2.6.1
-pycurl==7.43.0
-pygraphviz==1.3.1
-pykwalify==1.6.0
-pyparsing==2.1.8
-python-cinderclient==1.8.0
-python-consul==0.7.0
-python-dateutil==2.5.3
-python-designateclient==2.3.0
-python-gflags==3.0.6
-python-glanceclient==2.5.0
-python-heatclient==1.4.0
-python-ironicclient==1.6.0
-python-keyczar==0.716
-python-keystoneclient==3.5.0
+pyinotify==0.9.6
+pykwalify==1.6.1
+pyparsing==2.2.0
+pyperclip==1.6.0
+python-cinderclient==3.5.0
+python-consul==0.7.2
+python-dateutil==2.7.2
+python-glanceclient==2.9.1
+python-keystoneclient==3.15.0
 python-logstash==0.4.6
-python-magnumclient==2.3.0
-python-mistralclient==2.1.0
 python-neutronclient==5.1.0
-python-novaclient==5.1.0
-python-openstackclient==3.1.0
-python-swiftclient==3.0.0
-python-troveclient==2.5.0
-repoze.lru==0.6
-requests==2.11.1
-requestsexceptions==1.1.3
-retrying==1.3.3
-rfc3986==0.4.1
+python-novaclient==10.1.0
+python-openstackclient==3.14.0
+pytz==2018.3
+redis==2.10.6
+repoze.lru==0.7
+requests==2.18.4
+requestsexceptions==1.4.0
+rfc3986==1.1.0
 rsa==3.4.2
-ruamel.ordereddict==0.4.9
-ruamel.yaml==0.11.15
-service_identity==17.0.0
-shade==1.9.0
-simplejson==3.8.2
+service-identity==17.0.0
+shade==1.27.1
+simplejson==3.13.2
 six==1.11.0
-stevedore==1.17.1
+statsd==3.2.2
+stevedore==1.28.0
 structlog==18.1.0
-supervisor==3.0b2
-texttable==0.8.7
-tosca-parser==0.8.1
-twisted==16.6.0
+subprocess32==3.2.7
+tenacity==4.9.0
+tosca-parser==0.9.0
+typing==3.6.4
 unicodecsv==0.14.1
-uritemplate==0.6
-urllib3==1.7.1
-warlock==1.2.0
-websocket_client==0.39.0
-werkzeug==0.11.15
-wheel==0.24.0
-wrapt==1.10.8
-wsgiref==0.1.2
-zope.interface==4.3.3
-redis==2.10.5
-astunparse==1.5.0
-plyxproto==3.0.1
-setuptools==38.5.2
+uritemplate==3.0.0
+urllib3==1.22
+vine==1.1.4
+warlock==1.3.0
+wrapt==1.10.11
+zope.interface==4.4.3