change all templates to use and changed tag to 1.1 in .env

This commit is contained in:
Cindy Deng 2021-03-16 12:08:24 -07:00
Родитель d0ec974cb1
Коммит afa18dd338
29 изменённых файлов: 40 добавлений и 441 удалений

Просмотреть файл

@ -1,90 +0,0 @@
#
# CONNECTION STRINGS
#
IOTHUB_CONNECTION_STRING=""
DEVICE_CONNECTION_STRING=""
#
# CONTAINER REGISTRY
#
# Settings for your default container registry.
# - Local Registry: Set CONTAINER_REGISTRY_SERVER to "localhost:5000" - USERNAME/PASSWORD are not required.
# - Azure Container Registry: Set CONTAINER_REGISTRY_SERVER to "myregistry.azurecr.io". USERNAME/PASSWORD are required.
# - Docker Hub: Set CONTAINER_REGISTRY_SERVER and CONTAINER_REGISTRY_USERNAME to your Docker Hub username. Set CONTAINER_REGISTRY_PASSWORD to your Docker Hub password.
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_SERVER_2=""
# CONTAINER_REGISTRY_USERNAME_2=""
# CONTAINER_REGISTRY_PASSWORD_2=""
#
# HOST
#
RUNTIME_TAG="1.0"
#
# 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=""
# "" - 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=""
#
# SOLUTION SETTINGS
#
CONFIG_OUTPUT_DIR="config"
DEPLOYMENT_CONFIG_TEMPLATE_FILE="deployment.template.json"
DEPLOYMENT_CONFIG_DEBUG_TEMPLATE_FILE="deployment.debug.template.json"
DEFAULT_PLATFORM="amd64"
MODULES_PATH="modules"
LOGS_PATH="logs"
#
# DOCKER LOGS COMMAND
#
# Command used when calling iotedgedev docker --logs or --show-logs
LOGS_CMD="start /B start cmd.exe @cmd /k docker logs {0} -f"
# "start /B start cmd.exe @cmd /k docker logs {0} -f" - for CMD
# "docker logs {0} -f -new_console:sV" - for ConEmu
#
# AZURE SETTINGS
#
# These settings will override parameters to the `iotedgedev azure --setup` command.
# CREDENTIALS="username password"
# SERVICE_PRINCIPAL="username password tenant"
# RESOURCE_GROUP_LOCATION="australiaeast|australiasoutheast|brazilsouth|canadacentral|canadaeast|centralindia|centralus|eastasia|eastus|eastus2|japanwest|japaneast|northeurope|northcentralus|southindia|uksouth|ukwest|westus|westeurope|southcentralus|westcentralus|westus2"
# IOTHUB_SKU="F1|S1|S2|S3"
# UPDATE_DOTENV="True|False"
SUBSCRIPTION_ID=""
RESOURCE_GROUP_NAME=""
RESOURCE_GROUP_LOCATION=""
IOTHUB_NAME=""
IOTHUB_SKU=""
EDGE_DEVICE_ID=""
CREDENTIALS=""
SERVICE_PRINCIPAL=""
UPDATE_DOTENV=""

Просмотреть файл

@ -30,7 +30,7 @@ CONTAINER_REGISTRY_PASSWORD=""
# HOST
#
RUNTIME_TAG="1.0"
RUNTIME_TAG="1.1"
#
# MODULES

Просмотреть файл

@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
iproute2 \
iputils-ping \
gnupg2 \
systemd && \
rm -rf /var/lib/apt/lists/*
RUN curl https://packages.microsoft.com/config/ubuntu/18.04/multiarch/prod.list > ./microsoft-prod.list && \
@ -21,4 +22,4 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY rund.sh rund.sh
RUN sed -i 's/\r//' ./rund.sh && \
chmod u+x rund.sh
ENTRYPOINT [ "./rund.sh" ]
ENTRYPOINT [ "./rund.sh" ]

Просмотреть файл

@ -8,8 +8,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
iproute2 \
libcurl3 \
libffi-dev \
libssl1.0.0=1.0.2g-1ubuntu4.13 \
libssl-dev=1.0.2g-1ubuntu4.13 \
libssl1.0.0=1.0.2g-1ubuntu5.6 \
libssl-dev=1.0.2g-1ubuntu5.6 \
systemd && \
rm -rf /var/lib/apt/lists/*

Просмотреть файл

@ -3,7 +3,7 @@
echo '=> detecting IP'
export IP=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)
export IOT_DEVICE_HOSTNAME="$IP"
export AGENT_IMAGE="mcr.microsoft.com/azureiotedge-agent:1.0@sha256:3fdb80a6dfe1fbcbf11cfcea56dda79d1d779490c66d394a2b3f388d74ab0c26"
export AGENT_IMAGE="mcr.microsoft.com/azureiotedge-agent:1.1@sha256:84d81e0527799e903fca9602c56efcbc43ce6f90eaeb7316fddc7d663d40d1b1"
#export IOTEDGE_LOG=edgelet=debug
echo '=> creating config.yaml'

Просмотреть файл

@ -30,7 +30,7 @@ CONTAINER_REGISTRY_PASSWORD=""
# HOST
#
RUNTIME_TAG="1.0"
RUNTIME_TAG="1.1"
#
# MODULES

Просмотреть файл

@ -25,7 +25,7 @@
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0"
"image": "mcr.microsoft.com/azureiotedge-agent:${RUNTIME_TAG}"
}
},
"edgeHub": {
@ -33,7 +33,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"image": "mcr.microsoft.com/azureiotedge-hub:${RUNTIME_TAG}",
"createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5671/tcp\":[{\"HostPort\":\"5671\"}],\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}]}}}"
}
}
@ -45,7 +45,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:${RUNTIME_TAG}",
"createOptions": "{\"Env\":[\"abcdefghij0=00\",\"abcdefghij1=01\",\"abcdefghij2=02\",\"abcdefghij3=03\",\"abcdefghij4=04\",\"abcdefghij5=05\",\"abcdefghij6=06\",\"abcdefghij7=07\",\"abcdefghij8=08\",\"abcdefghij9=09\",\"abcdefghij10=10\",\"abcdefghij11=11\",\"abcdefghij12=12\",\"abcdefghij13=13\",\"abcdefghij14=14\",\"abcdefghij15=15\",\"abcdefghij16=16\",\"abcdefghij17=17\",\"abcdefghij18=18\",\"abcdefghij19=19\",\"abcdefghij20=20\",\"abcdefghij22=21\",\"abcdefghij22=22\",\"abcdefghij23=23\",\"abcdefghij24=24\",\"abcdefghij25=25\",\"abcdefghij26=26\",\"abcdefghij27=27\",\"abcdefghi",
"createOptions01": "j28=28\",\"abcdefghij29=29\",\"abcdefghij30=30\",\"abcdefghij31=31\",\"abcdefghij32=32\",\"abcdefghij33=33\",\"abcdefghij34=34\",\"abcdefghij35=35\",\"abcdefghij36=36\",\"abcdefghij37=37\",\"abcdefghij38=38\",\"abcdefghij39=39\",\"abcdefghij40=40\",\"abcdefghij41=41\",\"abcdefghij42=42\",\"abcdefghij43=43\",\"abcdefghij44=44\",\"abcdefghij45=45\",\"abcdefghij46=46\",\"abcdefghij47=47\",\"abcdefghij48=48\",\"abcdefghij49=49\",\"abcdefghij50=50\",\"abcdefghij51=51\",\"abcdefghij52=52\",\"abcdefghij53=53\",\"abcdefghij54=54\",\"abcdefghij55=55\",\"abcdefghij56abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh=56\",",
"createOptions02": "\"abcdefghij56abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh=57\",\"abcdefghij58=58\",\"abcdefghij59=59\"]}"

Просмотреть файл

@ -21,7 +21,7 @@
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0"
"image": "mcr.microsoft.com/azureiotedge-agent:${RUNTIME_TAG}"
}
},
"edgeHub": {
@ -29,7 +29,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"image": "mcr.microsoft.com/azureiotedge-hub:${RUNTIME_TAG}",
"createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5671/tcp\":[{\"HostPort\":\"5671\"}],\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}]}}}"
}
}
@ -41,7 +41,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:${RUNTIME_TAG}",
"createOptions": "{\"Env\":[\"abcdefghij0=00\",\"abcdefghij1=01\",\"abcdefghij2=02\",\"abcdefghij3=03\",\"abcdefghij4=04\",\"abcdefghij5=05\",\"abcdefghij6=06\",\"abcdefghij7=07\",\"abcdefghij8=08\",\"abcdefghij9=09\",\"abcdefghij10=10\",\"abcdefghij11=11\",\"abcdefghij12=12\",\"abcdefghij13=13\",\"abcdefghij14=14\",\"abcdefghij15=15\",\"abcdefghij16=16\",\"abcdefghij17=17\",\"abcdefghij18=18\",\"abcdefghij19=19\",\"abcdefghij20=20\",\"abcdefghij22=21\",\"abcdefghij22=22\",\"abcdefghij23=23\",\"abcdefghij24=24\",\"abcdefghij25=25\",\"abcdefghij26=26\",\"abcdefghij27=27\",\"abcdefghi",
"createOptions01": "j28=28\",\"abcdefghij29=29\",\"abcdefghij30=30\",\"abcdefghij31=31\",\"abcdefghij32=32\",\"abcdefghij33=33\",\"abcdefghij34=34\",\"abcdefghij35=35\",\"abcdefghij36=36\",\"abcdefghij37=37\",\"abcdefghij38=38\",\"abcdefghij39=39\",\"abcdefghij40=40\",\"abcdefghij41=41\",\"abcdefghij42=42\",\"abcdefghij43=43\",\"abcdefghij44=44\",\"abcdefghij45=45\",\"abcdefghij46=46\",\"abcdefghij47=47\",\"abcdefghij48=48\",\"abcdefghij49=49\",\"abcdefghij50=50\",\"abcdefghij51=51\",\"abcdefghij52=52\",\"abcdefghij53=53\",\"abcdefghij54=54\",\"abcdefghij55=55\",\"abcdefghij56abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh=56\",",
"createOptions02": "\"abcdefghij56abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh=57\",\"abcdefghij58=58\",\"abcdefghij59=59\"]}"

Просмотреть файл

@ -25,7 +25,7 @@
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0"
"image": "mcr.microsoft.com/azureiotedge-agent:${RUNTIME_TAG}"
}
},
"edgeHub": {
@ -33,7 +33,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"image": "mcr.microsoft.com/azureiotedge-hub:${RUNTIME_TAG}",
"createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5671/tcp\":[{\"HostPort\":\"5671\"}],\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}]}}}"
}
}
@ -45,7 +45,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:${RUNTIME_TAG}",
"createOptions": "{}"
}
}

Просмотреть файл

@ -15,7 +15,7 @@
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"image": "mcr.microsoft.com/azureiotedge-agent:${RUNTIME_TAG}",
"createOptions": ""
}
},
@ -24,7 +24,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"image": "mcr.microsoft.com/azureiotedge-hub:${RUNTIME_TAG}",
"createOptions": {
"HostConfig": {
"PortBindings": {
@ -56,7 +56,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:${RUNTIME_TAG}",
"createOptions": {
"Env": [
"abcdefghij0=00",

Просмотреть файл

@ -15,7 +15,7 @@
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"image": "mcr.microsoft.com/azureiotedge-agent:${RUNTIME_TAG}",
"createOptions": ""
}
},
@ -24,7 +24,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"image": "mcr.microsoft.com/azureiotedge-hub:${RUNTIME_TAG}",
"createOptions": {
"HostConfig": {
"PortBindings": {
@ -56,7 +56,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:${RUNTIME_TAG}",
"createOptions": {
"Env": [
"abcdefghij0=00",

Просмотреть файл

@ -15,7 +15,7 @@
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"image": "mcr.microsoft.com/azureiotedge-agent:${RUNTIME_TAG}",
"createOptions": ""
}
},
@ -24,7 +24,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"image": "mcr.microsoft.com/azureiotedge-hub:${RUNTIME_TAG}",
"createOptions": {
"HostConfig": {
"PortBindings": {
@ -56,7 +56,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:${RUNTIME_TAG}",
"createOptions": {
"Env": [
"abcdefghij0=00",

Просмотреть файл

@ -25,7 +25,7 @@
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"image": "mcr.microsoft.com/azureiotedge-agent:${RUNTIME_TAG}",
"createOptions": ""
}
},
@ -34,7 +34,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"image": "mcr.microsoft.com/azureiotedge-hub:${RUNTIME_TAG}",
"createOptions": {
"HostConfig": {
"PortBindings": {
@ -66,7 +66,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:${RUNTIME_TAG}",
"createOptions": {
"Env": [
"abcdefghij0=00",

Просмотреть файл

@ -15,7 +15,7 @@
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"image": "mcr.microsoft.com/azureiotedge-agent:${RUNTIME_TAG}",
"createOptions": {}
}
},
@ -24,7 +24,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"image": "mcr.microsoft.com/azureiotedge-hub:${RUNTIME_TAG}",
"createOptions": {
"HostConfig": {
"PortBindings": {
@ -56,7 +56,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:${RUNTIME_TAG}",
"createOptions": {}
}
},

Просмотреть файл

@ -16,7 +16,7 @@
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"image": "mcr.microsoft.com/azureiotedge-agent:${RUNTIME_TAG}",
"createOptions": {}
}
},
@ -25,7 +25,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"image": "mcr.microsoft.com/azureiotedge-hub:${RUNTIME_TAG}",
"createOptions": {
"HostConfig": {
"PortBindings": {
@ -57,7 +57,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:${RUNTIME_TAG}",
"createOptions": {}
}
},

Просмотреть файл

@ -16,7 +16,7 @@
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"image": "mcr.microsoft.com/azureiotedge-agent:${RUNTIME_TAG}",
"createOptions": {}
}
},
@ -25,7 +25,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"image": "mcr.microsoft.com/azureiotedge-hub:${RUNTIME_TAG}",
"createOptions": {
"HostConfig": {
"PortBindings": {
@ -57,7 +57,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:${RUNTIME_TAG}",
"createOptions": {}
}
},

Просмотреть файл

@ -22,7 +22,7 @@
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"image": "mcr.microsoft.com/azureiotedge-agent:${RUNTIME_TAG}",
"createOptions": {}
}
},
@ -31,7 +31,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"image": "mcr.microsoft.com/azureiotedge-hub:${RUNTIME_TAG}",
"createOptions": {
"HostConfig": {
"PortBindings": {
@ -63,7 +63,7 @@
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:${RUNTIME_TAG}",
"createOptions": {}
}
},

Просмотреть файл

@ -1,2 +0,0 @@
[b|B]in
[O|o]bj

Просмотреть файл

@ -1,34 +0,0 @@
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
.vs
[Bb]in/
[Oo]bj/

Просмотреть файл

@ -1,17 +0,0 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim
WORKDIR /app
COPY --from=build-env /app/out ./
RUN useradd -ms /bin/bash moduleuser
USER moduleuser
ENTRYPOINT ["dotnet", "SampleModule.dll"]

Просмотреть файл

@ -1,24 +0,0 @@
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim AS base
RUN apt-get update && \
apt-get install -y --no-install-recommends unzip procps && \
rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash moduleuser
USER moduleuser
RUN curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Debug -o out
FROM base
WORKDIR /app
COPY --from=build-env /app/out ./
ENTRYPOINT ["dotnet", "SampleModule.dll"]

Просмотреть файл

@ -1,17 +0,0 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster-arm32v7 AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm32v7
WORKDIR /app
COPY --from=build-env /app/out ./
RUN useradd -ms /bin/bash moduleuser
USER moduleuser
ENTRYPOINT ["dotnet", "SampleModule.dll"]

Просмотреть файл

@ -1,24 +0,0 @@
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm32v7 AS base
RUN apt-get update && \
apt-get install -y --no-install-recommends unzip procps && \
rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash moduleuser
USER moduleuser
RUN curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster-arm32v7 AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Debug -o out
FROM base
WORKDIR /app
COPY --from=build-env /app/out ./
ENTRYPOINT ["dotnet", "SampleModule.dll"]

Просмотреть файл

@ -1,17 +0,0 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster-arm64v8 AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm64v8
WORKDIR /app
COPY --from=build-env /app/out ./
RUN useradd -ms /bin/bash moduleuser
USER moduleuser
ENTRYPOINT ["dotnet", "SampleModule.dll"]

Просмотреть файл

@ -1,24 +0,0 @@
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm64v8 AS base
RUN apt-get update && \
apt-get install -y --no-install-recommends unzip procps && \
rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash moduleuser
USER moduleuser
RUN curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster-arm64v8 AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Debug -o out
FROM base
WORKDIR /app
COPY --from=build-env /app/out ./
ENTRYPOINT ["dotnet", "SampleModule.dll"]

Просмотреть файл

@ -1,13 +0,0 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1809 AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-nanoserver-1809
WORKDIR /app
COPY --from=build-env /app/out ./
ENTRYPOINT ["dotnet", "SampleModule.dll"]

Просмотреть файл

@ -1,92 +0,0 @@
namespace SampleModule
{
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Loader;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Client;
using Microsoft.Azure.Devices.Client.Transport.Mqtt;
class Program
{
static int counter;
static void Main(string[] args)
{
Init().Wait();
// Wait until the app unloads or is cancelled
var cts = new CancellationTokenSource();
AssemblyLoadContext.Default.Unloading += (ctx) => cts.Cancel();
Console.CancelKeyPress += (sender, cpe) => cts.Cancel();
WhenCancelled(cts.Token).Wait();
}
/// <summary>
/// Handles cleanup operations when app is cancelled or unloads
/// </summary>
public static Task WhenCancelled(CancellationToken cancellationToken)
{
var tcs = new TaskCompletionSource<bool>();
cancellationToken.Register(s => ((TaskCompletionSource<bool>)s).SetResult(true), tcs);
return tcs.Task;
}
/// <summary>
/// Initializes the ModuleClient and sets up the callback to receive
/// messages containing temperature information
/// </summary>
static async Task Init()
{
MqttTransportSettings mqttSetting = new MqttTransportSettings(TransportType.Mqtt_Tcp_Only);
ITransportSettings[] settings = { mqttSetting };
// Open a connection to the Edge runtime
ModuleClient ioTHubModuleClient = await ModuleClient.CreateFromEnvironmentAsync(settings);
await ioTHubModuleClient.OpenAsync();
Console.WriteLine("IoT Hub module client initialized.");
// Register callback to be called when a message is received by the module
await ioTHubModuleClient.SetInputMessageHandlerAsync("input1", PipeMessage, ioTHubModuleClient);
}
/// <summary>
/// This method is called whenever the module is sent a message from the EdgeHub.
/// It just pipe the messages without any change.
/// It prints all the incoming messages.
/// </summary>
static async Task<MessageResponse> PipeMessage(Message message, object userContext)
{
int counterValue = Interlocked.Increment(ref counter);
var moduleClient = userContext as ModuleClient;
if (moduleClient == null)
{
throw new InvalidOperationException("UserContext doesn't contain " + "expected values");
}
byte[] messageBytes = message.GetBytes();
string messageString = Encoding.UTF8.GetString(messageBytes);
Console.WriteLine($"Received message: {counterValue}, Body: [{messageString}]");
if (!string.IsNullOrEmpty(messageString))
{
using (var pipeMessage = new Message(messageBytes))
{
foreach (var prop in message.Properties)
{
pipeMessage.Properties.Add(prop.Key, prop.Value);
}
await moduleClient.SendEventAsync("output1", pipeMessage);
Console.WriteLine("Received message sent");
}
}
return MessageResponse.Completed;
}
}
}

Просмотреть файл

@ -1,26 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp3.1|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
</PropertyGroup>
<ItemGroup>
<ProjectCapability Include="AzureIoTEdgeModule"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.*" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,22 +0,0 @@
{
"$schema-version": "0.0.1",
"description": "",
"image": {
"repository": "localhost:5000/samplemodule",
"tag": {
"version": "0.0.1",
"platforms": {
"amd64": "./Dockerfile.amd64",
"amd64.debug": "./Dockerfile.amd64.debug",
"arm32v7": "./Dockerfile.arm32v7",
"arm32v7.debug": "./Dockerfile.arm32v7.debug",
"arm64v8": "./Dockerfile.arm64v8",
"arm64v8.debug": "./Dockerfile.arm64v8.debug",
"windows-amd64": "./Dockerfile.windows-amd64"
}
},
"buildOptions": [],
"contextPath": "./"
},
"language": "csharp"
}