get parados docker-compose working

This commit is contained in:
mpicci200_comcast
2025-02-04 19:39:03 -05:00
parent a998c2fb14
commit e6e6e000fc
17 changed files with 26847 additions and 43 deletions

View File

@@ -6,7 +6,7 @@ brought up for current ease of use. Future releases will deprecate Tr1d1um.
1. Clone this repository
2. Run `deploy/docker-compose-new/deploy.sh`
2. Run `deploy/docker-compose-xmidt-agent/deploy.sh`
It will then run `docker-compose up` which uses images of `talaria`, `scytale`, `petasos`, `caduceus`, `xmidt-agent` (device simulator) and `tr1d1um` from dockerhub.
@@ -105,7 +105,7 @@ Content-Type: text/plain; charset=utf-8
{"code": 404, "message": "Could not process device request: The device does not exist"}
```
Check out that your simulator is connected:
Check out that your simulator is connected (you may need to wait 30 to 60 seconds):
```
curl -i -H "Authorization: Basic dXNlcjpwYXNz" "http://localhost:6100/api/v2/device/mac:112233445566/stat"

239
deploy/docker-compose.yml Normal file
View File

@@ -0,0 +1,239 @@
---
networks:
xmidt: ~
services:
argus:
container_name: argus
depends_on:
- dynamodb
environment:
- "AWS_ACCESS_KEY_ID=accessKey"
- "AWS_SECRET_ACCESS_KEY=secretKey"
- "AWS_ENDPOINT=http://dynamodb:4566"
- "AWS_REGION=local"
- "AWS_ENDPOINT=http://dynamodb:4566"
- "TRACING_PROVIDER_NAME=zipkin"
- "TRACING_PROVIDER_ENDPOINT=http://zipkin:9411/api/v2/spans"
- "ACCESS_LEVEL_CAPABILITY=x1:issuer:test:.*:all"
image: "ghcr.io/xmidt-org/argus:${ARGUS_VERSION}"
networks:
- xmidt
ports:
- "6600-6603:6600-6603"
volumes:
- "./docFiles/argus.yaml:/etc/argus/argus.yaml"
caduceus:
container_name: caduceus
depends_on:
- argus
environment:
- "CONSUL_HOST=consul0:8500"
- "ARGUS_HOST=http://argus:6600"
image: "ghcr.io/xmidt-org/caduceus:${CADUCEUS_VERSION}"
networks:
- xmidt
ports:
- "6000-6003:6000-6003"
consul0:
command: "agent -server -bootstrap-expect 1 -ui -client 0.0.0.0 -config-file consul.json"
container_name: consul0
hostname: consul0
image: "hashicorp/consul:${CONSUL_VERSION}"
networks:
- xmidt
ports:
- "8400:8400"
- "8500:8500"
- "8600:8600/tcp"
- "8600:8600/udp"
volumes:
- "./docFiles/consul-0.json:/consul.json:z"
consul1:
command: "agent -server -bootstrap-expect 1 -ui -client 0.0.0.0 -config-file consul.json"
container_name: consul1
depends_on:
- consul0
hostname: consul1
image: "hashicorp/consul:${CONSUL_VERSION}"
networks:
- xmidt
ports:
- "8401:8400"
- "8501:8500"
- "8601:8600/tcp"
- "8601:8600/udp"
volumes:
- "./docFiles/consul-1.json:/consul.json:z"
dynamodb:
container_name: dynamo-xmidt
hostname: dynamodb
image: amazon/dynamodb-local
environment:
AWS_ACCESS_KEY_ID: accessKey
AWS_SECRET_ACCESS_KEY: secretKey
AWS_REGION: local
command: -jar DynamoDBLocal.jar -inMemory -sharedDb -port 4566
networks:
- xmidt
ports:
- "4566:4566"
healthcheck:
test:
["CMD-SHELL",'if [ "$(curl -s -o /dev/null -I -w ''%{http_code}'' http://localhost:4566)" == "400" ]; then exit 0; else exit 1; fi',]
interval: 5s
timeout: 30s
retries: 3
start_period: 5s
petasos:
container_name: petasos
depends_on:
- consul0
environment:
- "CONSUL_HOST=consul0:8500"
image: "ghcr.io/xmidt-org/petasos:${PETASOS_VERSION}"
networks:
- xmidt
ports:
- "6400-6403:6400-6403"
prometheus:
command: "--log.level=debug --config.file=/prometheus-data/prometheus.yml"
container_name: prometheus-xmidt
depends_on:
- consul0
- consul1
image: prom/prometheus
networks:
- xmidt
ports:
- "9090:9090"
volumes:
- "./docFiles/prometheus.yml:/prometheus-data/prometheus.yml:z"
scytale:
container_name: scytale
depends_on:
- petasos
- argus
environment:
- "CONSUL_HOST=consul0:8500"
- "ARGUS_HOST=http://argus:6600"
- TRACING_PROVIDER_NAME=zipkin
- "TRACING_PROVIDER_ENDPOINT=http://zipkin:9411/api/v2/spans"
image: "ghcr.io/xmidt-org/scytale:${SCYTALE_VERSION}"
networks:
- xmidt
ports:
- "6300-6303:6300-6303"
simulator:
container_name: xmidt-agent
depends_on:
- talaria-0
# - talaria-1
# - talaria-2
- petasos
- themis
image: "ghcr.io/xmidt-org/xmidt-agent:${SIMULATOR_VERSION}"
networks:
- xmidt
volumes:
- "./docFiles/mock_tr181.json:/mock_tr181.json"
- "./docFiles/xmidt-agent.yaml:/etc/xmidt-agent/xmidt-agent.yaml"
talaria-0:
container_name: talaria
depends_on:
- consul0
- themis
environment:
- "CONSUL_HOST=consul0:8500"
- TRACING_PROVIDER_NAME=zipkin
- "TRACING_PROVIDER_ENDPOINT=http://zipkin:9411/api/v2/spans"
image: "ghcr.io/xmidt-org/talaria:${TALARIA_VERSION}"
networks:
- xmidt
ports:
- "6200-6204:6200-6204"
talaria-1:
container_name: talaria1
depends_on:
- consul0
- themis
environment:
- "CONSUL_HOST=consul0:8500"
- TRACING_PROVIDER_NAME=zipkin
- "TRACING_PROVIDER_ENDPOINT=http://zipkin:9411/api/v2/spans"
image: "ghcr.io/xmidt-org/talaria:${TALARIA_VERSION}"
networks:
- xmidt
ports:
- "6210-6214:6200-6204"
talaria-2:
container_name: talaria2
depends_on:
- consul0
- themis
environment:
- "CONSUL_HOST=consul1:8500"
- TRACING_PROVIDER_NAME=zipkin
- "TRACING_PROVIDER_ENDPOINT=http://zipkin:9411/api/v2/spans"
image: "ghcr.io/xmidt-org/talaria:${TALARIA_VERSION}"
networks:
- xmidt
ports:
- "6220-6224:6200-6204"
themis:
container_name: themis
hostname: themis
environment:
- "CONSUL_HOST=consul0:8500"
- TRACING_PROVIDER_NAME=zipkin
- "TRACING_PROVIDER_ENDPOINT=http://zipkin:9411/api/v2/spans"
image: themis
networks:
- xmidt
ports:
- "6500-6504:6500-6504"
volumes:
- "./docFiles/themis/themis.yaml:/etc/themis/themis.yaml"
tr1d1um:
container_name: tr1d1um
depends_on:
- argus
- scytale
environment:
- "CONSUL_HOST=consul0:8500"
- "ARGUS_HOST=http://argus:6600"
- TRACING_PROVIDER_NAME=zipkin
- "TRACING_PROVIDER_ENDPOINT=http://zipkin:9411/api/v2/spans"
image: "ghcr.io/xmidt-org/tr1d1um:${TR1D1UM_VERSION}"
networks:
- xmidt
ports:
- "6100-6103:6100-6103"
zipkin:
image: openzipkin/zipkin
networks:
- xmidt
ports:
- "9411:9411"
awscli-dynamo:
image: amazon/aws-cli
networks:
- xmidt
depends_on:
dynamodb:
condition: service_healthy
ports:
- "9000:9000"
environment:
AWS_ACCESS_KEY_ID: accessKey
AWS_SECRET_ACCESS_KEY: secretKey
AWS_REGION: local
command: "dynamodb --endpoint-url http://dynamodb:4566 create-table \
--table-name gifnoc \
--attribute-definitions \
AttributeName=bucket,AttributeType=S \
AttributeName=expires,AttributeType=N \
AttributeName=id,AttributeType=S \
--key-schema \
AttributeName=bucket,KeyType=HASH \
AttributeName=id,KeyType=RANGE"
version: "3.8"

View File

@@ -1,10 +1,10 @@
echo "Stopping services & removing containers..."
CADUCEUS_VERSION=${CADUCEUS_VERSION:-latest} \
ARGUS_VERSION=${ARGUS_VERSION:-latest} \
TR1D1UM_VERSION=${TR1D1UM_VERSION:-latest} \
CADUCEUS_VERSION=${CADUCEUS_VERSION:-latest-amd64} \
ARGUS_VERSION=${ARGUS_VERSION:-latest-amd64} \
TR1D1UM_VERSION=${TR1D1UM_VERSION:-latest-amd64} \
SCYTALE_VERSION=${SCYTALE_VERSION:-latest} \
PETASOS_VERSION=${PETASOS_VERSION:-latest} \
TALARIA_VERSION=${TALARIA_VERSION:-latest} \
THEMIS_VERSION=${THEMIS_VERSION:-latest} \
SIMULATOR_VERSION=${SIMULATOR_VERSION:-latest} \
SIMULATOR_VERSION=${SIMULATOR_VERSION:-latest-amd64} \
docker compose down --remove-orphans

View File

@@ -12,42 +12,15 @@ popd
echo "Running services..."
CONSUL_VERSION=${CONSUL_VERSION:-1.12.6} \
CADUCEUS_VERSION=${CADUCEUS_VERSION:-latest} \
ARGUS_VERSION=${ARGUS_VERSION:-latest} \
TR1D1UM_VERSION=${TR1D1UM_VERSION:-latest} \
SCYTALE_VERSION=${SCYTALE_VERSION:-latest} \
CADUCEUS_VERSION=${CADUCEUS_VERSION:-latest-amd64} \
ARGUS_VERSION=${ARGUS_VERSION:-latest-amd64} \
TR1D1UM_VERSION=${TR1D1UM_VERSION:-latest-amd64} \
SCYTALE_VERSION=${SCYTALE_VERSION:-latest-amd64} \
PETASOS_VERSION=${PETASOS_VERSION:-latest} \
TALARIA_VERSION=${TALARIA_VERSION:-latest} \
THEMIS_VERSION=${THEMIS_VERSION:-latest} \
SIMULATOR_VERSION=${SIMULATOR_VERSION:-latest} \
docker-compose -f $ROOT_DIR/deploy/docker-compose/docker-compose.yml up -d $@
docker compose -f $ROOT_DIR/deploy/docker-compose-c/docker-compose.yml up -d $@
if [[ $? -ne 0 ]]; then
exit 1
fi
sleep 10
AWS_ACCESS_KEY_ID=accessKey AWS_SECRET_ACCESS_KEY=secretKey aws dynamodb --endpoint-url http://localhost:8000 describe-table --table-name gifnoc --region us-east-2 --output text > /dev/null 2> /dev/null
if [[ $? -ne 0 ]]; then
AWS_ACCESS_KEY_ID=accessKey AWS_SECRET_ACCESS_KEY=secretKey aws dynamodb --endpoint-url http://localhost:8000 create-table \
--table-name gifnoc \
--attribute-definitions \
AttributeName=bucket,AttributeType=S \
AttributeName=expires,AttributeType=N \
AttributeName=id,AttributeType=S \
--key-schema \
AttributeName=bucket,KeyType=HASH \
AttributeName=id,KeyType=RANGE \
--global-secondary-indexes \
"[{\"IndexName\": \"Expires-index\",\"KeySchema\":[{\"AttributeName\":\"bucket\",\"KeyType\":\"HASH\"}, {\"AttributeName\":\"expires\",\"KeyType\":\"RANGE\"}], \
\"ProvisionedThroughput\": {\"ReadCapacityUnits\": 10, \"WriteCapacityUnits\": 5 },\"Projection\":{\"ProjectionType\":\"ALL\"}}]" \
--provisioned-throughput \
ReadCapacityUnits=10,WriteCapacityUnits=5 \
--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES \
--region us-east-2 \
--output text
AWS_ACCESS_KEY_ID=accessKey AWS_SECRET_ACCESS_KEY=secretKey aws dynamodb \
--endpoint-url http://localhost:8000 --region us-east-2 update-time-to-live \
--table-name gifnoc --time-to-live-specification "Enabled=true, AttributeName=expires" \
--output text
fi
fi

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,122 @@
# SPDX-FileCopyrightText: 2022 Comcast Cable Communications Management, LLC
# SPDX-License-Identifier: Apache-2.0
---
# The unique fully-qualified-domain-name of the server. It is provided to
# the X-Scytale-Server header for showing what server fulfilled the request
# sent.
# (Optional)
server: themis
########################################
# Labeling/Tracing via HTTP Headers Configuration
########################################
# Provides this build number to the X-Scytale-Build header for
# showing machine version information. The build number SHOULD
# match the scheme `version-build` but there is not a strict requirement.
# (Optional)
build: unknown
# stage is used for doing complex spruce manipulation
# change this will only effect spruce and the vars referencing it
stage: "development"
servers:
key:
address: :6500
disableHTTPKeepAlives: true
header:
X-Midt-Server:
- themis
X-Midt-Version:
- unknown
issuer:
address: :6501
disableHTTPKeepAlives: true
header:
X-Midt-Server:
- themis
X-Midt-Version:
- unknown
claims:
address: :6502
disableHTTPKeepAlives: true
header:
X-Midt-Server:
- themis
X-Midt-Version:
- unknown
metrics:
address: :6503
disableHTTPKeepAlives: true
health:
address: :6504
disableHTTPKeepAlives: true
header:
X-Midt-Server:
- themis
X-Midt-Version:
- unknown
health:
disableLogging: false
custom:
server: themis
prometheus:
defaultNamespace: xmidt
defaultSubsystem: themis
token:
alg: RS256
nonce: true
notBeforeDelta: -15s
duration: 24h
claims:
- key: mac
header: X-Midt-Mac-Address
parameter: mac
- key: serial
header: X-Midt-Serial-Number
parameter: serial
- key: uuid
header: X-Midt-Uuid
parameter: uuid
- key: iss
value: "themis"
- key: trust
value: 1000
- key: sub
value: "client-supplied"
- key: aud
value: "XMiDT"
- key: capabilities
value:
- x1:issuer:test:.*:all
metadata:
- key: mac
header: X-Midt-Mac-Address
parameter: mac
- key: serial
header: X-Midt-Serial-Number
parameter: serial
- key: uuid
header: X-Midt-Uuid
parameter: uuid
partnerID:
claim: partner-id
header: X-Midt-Partner-ID
parameter: pid
default: comcast
key:
kid: docker
type: rsa
bits: 2048
log:
outputPaths:
- "stdout"
errorOutputPaths:
- "stdout"
level: debug

View File

@@ -0,0 +1,36 @@
# SPDX-FileCopyrightText: 2023 Comcast Cable Communications Management, LLC
# SPDX-License-Identifier: Apache-2.0
websocket:
url_path: api/v2/device
back_up_url: http://petasos:6400
xmidt_credentials:
url: http://themis:6501/issue
file_name: xmidt_agent_creds.txt
file_permissions: 0777
identity:
device_id: mac:112233445566
serial_number: 1800deadbeef
hardware_model: fooModel
hardware_manufacturer: barManufacturer
firmware_version: v0.0.1
partner_id: foobar
xmidt_service:
backoff:
max_delay: 600s
min_delay: 7s
url: http://petasos:6400
operational_state:
last_reboot_reason: sleepy
boot_time: "2024-02-28T01:04:27Z"
storage:
temporary: ~/local-rdk-testing/temporary
durable: ~/local-rdk-testing/durable
mock_tr_181:
enabled: true
file_path: /mock_tr181.json
lib_parodus:
parodus_service_url: "tcp://127.0.0.1:6666"
logger:
level: debug
development: true

View File

@@ -7,7 +7,7 @@ services:
depends_on:
- dynamodb
environment:
- "AWS_ENDPOINT=http://dynamodb:8000"
- "AWS_ENDPOINT=http://dynamodb:4566"
- "TRACING_PROVIDER_NAME=zipkin"
- "TRACING_PROVIDER_ENDPOINT=http://zipkin:9411/api/v2/spans"
- "ACCESS_LEVEL_CAPABILITY=x1:issuer:test:.*:all"
@@ -62,10 +62,22 @@ services:
container_name: dynamo-xmidt
hostname: dynamodb
image: amazon/dynamodb-local
environment:
AWS_ACCESS_KEY_ID: accessKey
AWS_SECRET_ACCESS_KEY: secretKey
AWS_REGION: local
command: -jar DynamoDBLocal.jar -inMemory -sharedDb -port 4566
networks:
- xmidt
ports:
- "8000:8000"
- "4566:4566"
healthcheck:
test:
["CMD-SHELL",'if [ "$(curl -s -o /dev/null -I -w ''%{http_code}'' http://localhost:4566)" == "400" ]; then exit 0; else exit 1; fi',]
interval: 5s
timeout: 30s
retries: 3
start_period: 5s
petasos:
container_name: petasos
depends_on:
@@ -117,7 +129,7 @@ services:
networks:
- xmidt
talaria-0:
container_name: talaria0
container_name: talaria
depends_on:
- consul0
- themis
@@ -169,6 +181,8 @@ services:
- xmidt
ports:
- "6500-6504:6500-6504"
volumes:
- "./docFiles/themis.yaml:/etc/themis/themis.yaml"
tr1d1um:
container_name: tr1d1um
depends_on:
@@ -184,10 +198,31 @@ services:
- xmidt
ports:
- "6100-6103:6100-6103"
awscli-dynamo:
image: amazon/aws-cli
networks:
- xmidt
depends_on:
dynamodb:
condition: service_healthy
ports:
- "4577:4577"
environment:
AWS_ACCESS_KEY_ID: accessKey
AWS_SECRET_ACCESS_KEY: secretKey
AWS_REGION: local
command: "dynamodb --endpoint-url http://dynamodb:4566 create-table \
--table-name gifnoc \
--attribute-definitions \
AttributeName=bucket,AttributeType=S \
AttributeName=expires,AttributeType=N \
AttributeName=id,AttributeType=S \
--key-schema \
AttributeName=bucket,KeyType=HASH \
AttributeName=id,KeyType=RANGE"
zipkin:
image: openzipkin/zipkin
networks:
- xmidt
ports:
- "9411:9411"
version: "3.8"