Skip to content

Commit

Permalink
Clean up public preview stuff in .env (#259)
Browse files Browse the repository at this point in the history
* Remove references to public preview stuff

* Fix dotnet new failure during tox
  • Loading branch information
LazarusX authored and jongio committed Aug 16, 2018
1 parent f523887 commit a61e91a
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 143 deletions.
40 changes: 7 additions & 33 deletions .env.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DEVICE_CONNECTION_STRING=""
# Azure Container Registry: "jong.azurecr.io", Also set USERNAME/PASSWORD
# Docker Hub: "jongallant" - Your Docker hub username. Enter your Docker hub username into the CONTAINER_REGISTRY_USERNAME setting. Also set the PASSWORD.

CONTAINER_REGISTRY_SERVER="localhost:5000"
CONTAINER_REGISTRY_SERVER="localhost:5000"
CONTAINER_REGISTRY_USERNAME=""
CONTAINER_REGISTRY_PASSWORD=""

Expand All @@ -30,62 +30,36 @@ CONTAINER_REGISTRY_PASSWORD=""
# HOST
#

RUNTIME_HOME_DIR="."
# Directory to host the Runtime generated files and certs
# "." - Auto detect, defaults to the following:
# "%PROGRAMDATA%\azure-iot-edge\data" - Windows
# "/var/lib/azure-iot-edge" - Linux
# "/var/lib/azure-iot-edge" - Mac

RUNTIME_CONFIG_DIR="."
# Directory to host the Runtime config files
# "." - Auto detect, defaults to the following:
# "%PROGRAMDATA%\azure-iot-edge\config" - Windows
# "/etc/azure-iot-edge" - Linux
# "/etc/azure-iot-edge" - Mac

RUNTIME_HOST_NAME="."
# "." - Auto detect

RUNTIME_TAG="1.0"

RUNTIME_VERBOSITY="INFO"
# "DEBUG", "INFO", "ERROR", "WARNING"

RUNTIME_LOG_LEVEL="info"
# "debug", "info"

#
# MODULES
#

BYPASS_MODULES=""
# "" - to build all modules
# "*" - to bypass all modules
# "filtermodule, module1" - Comma delimited list of modules to bypass when building

ACTIVE_DOCKER_PLATFORMS="amd64"
# "*" - to build all docker files
# "amd64,amd64.debug" - Comma delimted list of docker files to build
ACTIVE_DOCKER_PLATFORMS=""
# "" - to only build platforms specified in DEPLOYMENT_CONFIG_TEMPLATE_FILE
# "*" - to build all platforms
# "amd64,amd64.debug" - Comma delimited list of platforms to build

CONTAINER_TAG=""
CONTAINER_TAG=""

DOTNET_VERBOSITY="q"
# q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]

DOTNET_EXE_DIR="./bin/Debug/netcoreapp2.0/publish"
# The default EXE_DIR directory to pass to the Docker build command.

#
# SOLUTION SETTINGS
#

CONFIG_OUTPUT_DIR="config"
DEPLOYMENT_CONFIG_FILE="deployment.json"
DEPLOYMENT_CONFIG_TEMPLATE_FILE="deployment.template.json"
RUNTIME_CONFIG_FILE="runtime.json"
LOGS_PATH="logs"
MODULES_PATH="modules"
IOT_REST_API_VERSION="2017-11-08-preview"

#
# DOCKER LOGS COMMAND
Expand Down
6 changes: 3 additions & 3 deletions iotedgedev/dockercls.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ def setup_registry(self):

for image_name in image_names:

microsoft_image_name = "microsoft/{0}:{1}".format(
microsoft_image_name = "mcr.microsoft.com/{0}:{1}".format(
image_name, self.envvars.RUNTIME_TAG)

container_registry_image_name = "{0}/{1}:{2}".format(
default_cr.server, image_name, self.envvars.RUNTIME_TAG)

# Pull image from Microsoft Docker Hub
# Pull image from MCR
try:
self.output.info(
"PULLING IMAGE: '{0}'".format(microsoft_image_name))
Expand All @@ -99,7 +99,7 @@ def setup_registry(self):

# Tagging Image with Container Registry Name
try:
tag_result = self.docker_api.tag(
self.docker_api.tag(
image=microsoft_image_name, repository=container_registry_image_name)
except docker.errors.APIError as e:
self.output.error(
Expand Down
37 changes: 4 additions & 33 deletions iotedgedev/envvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def load(self, force=False):
try:
try:
self.IOTHUB_CONNECTION_STRING = self.get_envvar("IOTHUB_CONNECTION_STRING")
self.IOTHUB_CONNECTION_INFO = None;
self.IOTHUB_CONNECTION_INFO = None
if self.IOTHUB_CONNECTION_STRING:
self.IOTHUB_CONNECTION_INFO = IoTHubConnectionString(self.IOTHUB_CONNECTION_STRING)

Expand All @@ -119,45 +119,28 @@ def load(self, force=False):

try:
self.DEVICE_CONNECTION_STRING = self.get_envvar("DEVICE_CONNECTION_STRING")
self.DEVICE_CONNECTION_INFO = None;
self.DEVICE_CONNECTION_INFO = None
if self.DEVICE_CONNECTION_STRING:
self.DEVICE_CONNECTION_INFO = DeviceConnectionString(self.DEVICE_CONNECTION_STRING)

except Exception as ex:
self.output.error("Unable to parse DEVICE_CONNECTION_STRING Environment Variable. Please ensure that you have the right connection string set.")
self.output.error(str(ex))
sys.exit(-1)

self.get_registries()

self.RUNTIME_HOST_NAME = self.get_envvar("RUNTIME_HOST_NAME", default=".")
if self.RUNTIME_HOST_NAME == ".":
self.set_envvar("RUNTIME_HOST_NAME", socket.gethostname())

self.RUNTIME_HOME_DIR = self.get_envvar("RUNTIME_HOME_DIR", default=".")
if self.RUNTIME_HOME_DIR == ".":
self.set_envvar("RUNTIME_HOME_DIR", self.get_runtime_home_dir())
self.get_registries()

self.RUNTIME_CONFIG_DIR = self.get_envvar("RUNTIME_CONFIG_DIR", default=".")
if self.RUNTIME_CONFIG_DIR == ".":
self.set_envvar("RUNTIME_CONFIG_DIR", self.get_runtime_config_dir())
self.BYPASS_MODULES = self.get_envvar("BYPASS_MODULES")
self.ACTIVE_DOCKER_PLATFORMS = self.get_envvar("ACTIVE_DOCKER_PLATFORMS", altkeys=["ACTIVE_DOCKER_ARCH"])
self.CONTAINER_TAG = self.get_envvar("CONTAINER_TAG")
self.RUNTIME_TAG = self.get_envvar("RUNTIME_TAG")
self.RUNTIME_VERBOSITY = self.get_envvar("RUNTIME_VERBOSITY")
self.RUNTIME_LOG_LEVEL = self.get_envvar("RUNTIME_LOG_LEVEL", default="info")
self.CONFIG_OUTPUT_DIR = self.get_envvar("CONFIG_OUTPUT_DIR", default="config")
self.DEPLOYMENT_CONFIG_FILE = self.get_envvar("DEPLOYMENT_CONFIG_FILE", altkeys=['MODULES_CONFIG_FILE'])
self.DEPLOYMENT_CONFIG_FILE_PATH = os.path.join(self.CONFIG_OUTPUT_DIR, self.DEPLOYMENT_CONFIG_FILE)
self.DEPLOYMENT_CONFIG_TEMPLATE_FILE = self.get_envvar("DEPLOYMENT_CONFIG_TEMPLATE_FILE", default="deployment.template.json")
self.RUNTIME_CONFIG_FILE = self.get_envvar("RUNTIME_CONFIG_FILE")
self.RUNTIME_CONFIG_FILE_PATH = os.path.join(self.CONFIG_OUTPUT_DIR, self.RUNTIME_CONFIG_FILE)
self.LOGS_PATH = self.get_envvar("LOGS_PATH")
self.MODULES_PATH = self.get_envvar("MODULES_PATH")
self.IOT_REST_API_VERSION = self.get_envvar("IOT_REST_API_VERSION")
self.DOTNET_VERBOSITY = self.get_envvar("DOTNET_VERBOSITY")
self.DOTNET_EXE_DIR = self.get_envvar("DOTNET_EXE_DIR")
self.LOGS_CMD = self.get_envvar("LOGS_CMD")
self.SUBSCRIPTION_ID = self.get_envvar("SUBSCRIPTION_ID")
self.RESOURCE_GROUP_NAME = self.get_envvar("RESOURCE_GROUP_NAME")
Expand Down Expand Up @@ -267,21 +250,9 @@ def get_registries(self):
registries[token][subkey] = self.get_envvar(key)

# store parsed values as a dicitonary of containerregistry objects
for key, value in registries.items():
for key, value in registries.items():
self.CONTAINER_REGISTRY_MAP[key] = ContainerRegistry(value['server'], value['username'], value['password'])

def get_runtime_home_dir(self):
if self.is_posix():
return "/var/lib/azure-iot-edge"
else:
return os.environ["PROGRAMDATA"].replace("\\", "\\\\") + "\\\\azure-iot-edge\\\data"

def get_runtime_config_dir(self):
if self.is_posix():
return "/etc/azure-iot-edge"
else:
return os.environ["PROGRAMDATA"].replace("\\", "\\\\") + "\\\\azure-iot-edge\\\\config"

def is_posix(self):
plat = platform.system().lower()
return plat == "linux" or plat == "darwin"
Expand Down
38 changes: 9 additions & 29 deletions iotedgedev/template/.env.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEVICE_CONNECTION_STRING=""
#
# CONTAINER REGISTRY
#
# Settings for your container registry, set CONTAINER_REGISTRY_SERVER to the following:
# Settings for your container registry, set CONTAINER_REGISTRY_SERVER to the following as the default registry:
# Local Registry: "localhost:5000" - USERNAME/PASSWORD not required.
# Azure Container Registry: "jong.azurecr.io", Also set USERNAME/PASSWORD
# Docker Hub: "jongallant" - Your Docker hub username. Enter your Docker hub username into the CONTAINER_REGISTRY_USERNAME setting. Also set the PASSWORD.
Expand All @@ -18,35 +18,20 @@ CONTAINER_REGISTRY_SERVER="localhost:5000"
CONTAINER_REGISTRY_USERNAME=""
CONTAINER_REGISTRY_PASSWORD=""

# To specify additional container registries ensure the prefix is CONTAINER_REGISTRY_SERVER, CONTAINER_REGISTRY_USERNAME, CONTAINER_REGISTRY_PASSWORD
# And the token following the prefix uniquely associates the SERVER/USERNAME/PASSWORD
# Token can be any string of alphanumeric characters

# CONTAINER_REGISTRY_SERVER2=""
# CONTAINER_REGISTRY_USERNAME2=""
# CONTAINER_REGISTRY_PASSWORD2=""

#
# HOST
#

RUNTIME_HOME_DIR="."
# Directory to host the Runtime generated files and certs
# "." - Auto detect, defaults to the following:
# "%PROGRAMDATA%\azure-iot-edge\data" - Windows
# "/var/lib/azure-iot-edge" - Linux
# "/var/lib/azure-iot-edge" - Mac

RUNTIME_CONFIG_DIR="."
# Directory to host the Runtime config files
# "." - Auto detect, defaults to the following:
# "%PROGRAMDATA%\azure-iot-edge\config" - Windows
# "/etc/azure-iot-edge" - Linux
# "/etc/azure-iot-edge" - Mac

RUNTIME_HOST_NAME="."
# "." - Auto detect

RUNTIME_TAG="1.0"

RUNTIME_VERBOSITY="INFO"
# "DEBUG", "INFO", "ERROR", "WARNING"

RUNTIME_LOG_LEVEL="info"
# "debug", "info"

#
# MODULES
#
Expand All @@ -66,20 +51,15 @@ CONTAINER_TAG=""
DOTNET_VERBOSITY="q"
# q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]

DOTNET_EXE_DIR="./bin/Debug/netcoreapp2.0/publish"
# The default EXE_DIR directory to pass to the Docker build command.

#
# SOLUTION SETTINGS
#

CONFIG_OUTPUT_DIR="config"
DEPLOYMENT_CONFIG_FILE="deployment.json"
DEPLOYMENT_CONFIG_TEMPLATE_FILE="deployment.template.json"
RUNTIME_CONFIG_FILE="runtime.json"
LOGS_PATH="logs"
MODULES_PATH="modules"
IOT_REST_API_VERSION="2017-11-08-preview"

#
# DOCKER LOGS COMMAND
Expand Down
31 changes: 0 additions & 31 deletions iotedgedev/template/.vscode/launch.json

This file was deleted.

Binary file modified iotedgedev/template/template.zip
Binary file not shown.
Loading

0 comments on commit a61e91a

Please sign in to comment.