Compare commits

..

No commits in common. "main" and "v1.0.1" have entirely different histories.
main ... v1.0.1

10 changed files with 170 additions and 252 deletions

View file

@ -26,9 +26,6 @@ jobs:
id: docker
with:
images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }}
tags: |
type=sha,prefix=
type=ref,event=tag
-
name: Login to registry
uses: docker/login-action@v3
@ -36,6 +33,9 @@ jobs:
registry: ${{ steps.repository.outputs.registry }}
username: "${{ secrets.PACKAGES_USER }}"
password: "${{ secrets.PACKAGES_TOKEN }}"
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@ -49,4 +49,5 @@ jobs:
push: true
allow: network.host
network: host
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker.outputs.tags }}

View file

@ -0,0 +1,78 @@
name: createapp
on:
workflow_dispatch:
inputs:
a_app_region:
type: string
description: "Application Region e.g. EU"
default: EU
b_app_flavor:
type: string
description: "Application Flavor e.g. EU.small"
default: EU.small
env:
EDGEXR_PLATFORM_USERNAME: ${{ secrets.EDGEXR_PLATFORM_USERNAME }}
EDGEXR_PLATFORM_PASSWORD: ${{ secrets.EDGEXR_PLATFORM_PASSWORD }}
APP_REGION: ${{ inputs.a_app_region }}
APP_FLAVOR: ${{ inputs.b_app_flavor }}
jobs:
build:
runs-on: ubuntu-22.04
steps:
-
name: Repository meta
id: repository
run: |
registry=${{ github.server_url }}
registry=${registry##http*://}
echo "registry=${registry}" >> "$GITHUB_OUTPUT"
echo "registry=${registry}"
repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"
echo "repository=${repository}" >> "$GITHUB_OUTPUT"
echo "repository=${repository}"
-
name: Docker meta
uses: docker/metadata-action@v5
id: docker
with:
images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }}
-
name: Install Curl
run: |
sudo apt update
sudo apt install -y curl jq
-
name: Create edgeXR App
run: |
set -e
echo login
EDGEXR_TOKEN="$(curl -X POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/login -H 'Content-Type: application/json' --data '{"password": "'${EDGEXR_PLATFORM_PASSWORD}'","username": "'${EDGEXR_PLATFORM_USERNAME}'"}' -sSf | jq -r .token)"
CREATEAPP_JSON=$(cat <<EOF
{
"App": {
"key": {
"organization": "edp-developer-framework",
"name": "$(echo ${{ steps.repository.outputs.repository }} | sed -e 's|^.*/||')",
"version": "${{ steps.docker.outputs.version }}"
},
"image_path": "${{ steps.docker.outputs.tags }}",
"image_type": "Docker",
"access_ports": "tcp:80",
"default_flavor": {
"name": "${APP_FLAVOR}"
},
"deployment": "docker",
"required_outbound_connections": null
},
"Region": "${APP_REGION}"
}
EOF
)
echo create app
curl -X POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/auth/ctrl/CreateApp -H 'Content-Type: application/json' -H "Authorization: Bearer $EDGEXR_TOKEN" -S --data "$CREATEAPP_JSON" --fail-with-body

View file

@ -1,32 +0,0 @@
name: delete
on:
workflow_run:
workflows: [build]
types:
- completed
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Replace Image Version
run: |
sha="${{ github.sha }}"
shortSha="${sha:0:7}"
echo "Setting image version to: edp.buildth.ing/devfw-cicd/edgeconnect-action-demo:${shortSha}"
sed -i "s@###IMAGETAG###@edp.buildth.ing/devfw-cicd/edgeconnect-action-demo:${shortSha}@g" ./k8s-deployment.yaml
- name: Delete action
uses: https://edp.buildth.ing/DevFW-CICD/edge-connect-delete-action@main
id: delete
with:
configFile: ./EdgeConnectConfig.yaml
baseUrl: https://hub.apps.edge.platform.mg3.mdb.osc.live
username: ${{ secrets.EDGEXR_PLATFORM_USERNAME }}
password: ${{ secrets.EDGEXR_PLATFORM_PASSWORD }}

View file

View file

@ -1,32 +0,0 @@
name: deploy
on:
workflow_run:
workflows: [build]
types:
- completed
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Replace Image Version
run: |
sha="${{ github.sha }}"
shortSha="${sha:0:7}"
echo "Setting image version to: edp.buildth.ing/devfw-cicd/edgeconnect-action-demo:${shortSha}"
sed -i "s@###IMAGETAG###@edp.buildth.ing/devfw-cicd/edgeconnect-action-demo:${shortSha}@g" ./k8s-deployment.yaml
- name: Deploy action
uses: https://edp.buildth.ing/DevFW-CICD/edge-connect-deploy-action@main
id: deploy
with:
configFile: ./EdgeConnectConfig.yaml
baseUrl: https://hub.apps.edge.platform.mg3.mdb.osc.live
username: ${{ secrets.EDGEXR_PLATFORM_USERNAME }}
password: ${{ secrets.EDGEXR_PLATFORM_PASSWORD }}

View file

@ -1,5 +1 @@
FROM nginx
RUN rm -rf /usr/share/nginx/html/*
COPY --chmod=644 index.html /usr/share/nginx/html/
FROM nginx

View file

@ -1,29 +0,0 @@
# Is there a swagger file for the new EdgeConnect API?
# How does it differ from the EdgeXR API?
kind: edgeconnect-deployment
metadata:
name: "edge-app-demo" # name could be used for appName
appVersion: "1.0.0"
organization: "edp2"
spec:
# dockerApp: # Docker is OBSOLETE
# appVersion: "1.0.0"
# manifestFile: "./docker-compose.yaml"
# image: "https://registry-1.docker.io/library/nginx:latest"
k8sApp:
manifestFile: "./k8s-deployment.yaml" # store hash of the manifest file in annotation field. Annotations is a comma separated map of arbitrary key value pairs,
infraTemplate:
- region: "EU"
cloudletOrg: "TelekomOP"
cloudletName: "Munich"
flavorName: "EU.small"
network:
outboundConnections:
- protocol: "tcp"
portRangeMin: 80
portRangeMax: 80
remoteCIDR: "0.0.0.0/0"
- protocol: "tcp"
portRangeMin: 443
portRangeMax: 443
remoteCIDR: "0.0.0.0/0"

87
edge-calls.REST Normal file
View file

@ -0,0 +1,87 @@
POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/login HTTP/1.1
content-type: application/json
{
"password": "password",
"username": "email"
}
###
POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/auth/org/create HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTQ0ODMyNzcsImlhdCI6MTc1NDM5Njg3NywidXNlcm5hbWUiOiJyaXJlIiwiZW1haWwiOiJyaWNoYXJkLXJvYmVydC5yZWl0ekB0ZWxla29tLmRlIiwia2lkIjoxLCJmaXJzdGlhdCI6MTc1NDM5Njg3NywiYXV0aHR5cGUiOiJwYXNzd29yZGF1dGgiLCJhcGlrZXl1c2VybmFtZSI6IiIsIm9iamVjdHJlc3RyaWN0aW9uIjoiIiwib3JncmVzdHJpY3Rpb24iOiIiLCJpc3N1ZWRBdFByZWNpc2UiOiIyMDI1LTA4LTA1VDEyOjI3OjU3LjUwODEwOTE3OVoifQ.30GbJmvAFYEYadVBslDZeG9Cg8QwQodSxLXxKruRS9sgSfWTmrXR2DgielNGq6gEm-3qXUxmLffNV3MsX-3hAg
content-type: application/json
{
"Address": "edp-developer-framework address",
"Name": "edp-developer-framework",
"Phone": "01234567890",
"Type": "developer"
}
###
POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/auth/org/show HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTQ0ODMyNzcsImlhdCI6MTc1NDM5Njg3NywidXNlcm5hbWUiOiJyaXJlIiwiZW1haWwiOiJyaWNoYXJkLXJvYmVydC5yZWl0ekB0ZWxla29tLmRlIiwia2lkIjoxLCJmaXJzdGlhdCI6MTc1NDM5Njg3NywiYXV0aHR5cGUiOiJwYXNzd29yZGF1dGgiLCJhcGlrZXl1c2VybmFtZSI6IiIsIm9iamVjdHJlc3RyaWN0aW9uIjoiIiwib3JncmVzdHJpY3Rpb24iOiIiLCJpc3N1ZWRBdFByZWNpc2UiOiIyMDI1LTA4LTA1VDEyOjI3OjU3LjUwODEwOTE3OVoifQ.30GbJmvAFYEYadVBslDZeG9Cg8QwQodSxLXxKruRS9sgSfWTmrXR2DgielNGq6gEm-3qXUxmLffNV3MsX-3hAg
###
POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/auth/user/show HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTQ0ODMyNzcsImlhdCI6MTc1NDM5Njg3NywidXNlcm5hbWUiOiJyaXJlIiwiZW1haWwiOiJyaWNoYXJkLXJvYmVydC5yZWl0ekB0ZWxla29tLmRlIiwia2lkIjoxLCJmaXJzdGlhdCI6MTc1NDM5Njg3NywiYXV0aHR5cGUiOiJwYXNzd29yZGF1dGgiLCJhcGlrZXl1c2VybmFtZSI6IiIsIm9iamVjdHJlc3RyaWN0aW9uIjoiIiwib3JncmVzdHJpY3Rpb24iOiIiLCJpc3N1ZWRBdFByZWNpc2UiOiIyMDI1LTA4LTA1VDEyOjI3OjU3LjUwODEwOTE3OVoifQ.30GbJmvAFYEYadVBslDZeG9Cg8QwQodSxLXxKruRS9sgSfWTmrXR2DgielNGq6gEm-3qXUxmLffNV3MsX-3hAg
###
POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/auth/ctrl/ShowApp HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTQ0ODMyNzcsImlhdCI6MTc1NDM5Njg3NywidXNlcm5hbWUiOiJyaXJlIiwiZW1haWwiOiJyaWNoYXJkLXJvYmVydC5yZWl0ekB0ZWxla29tLmRlIiwia2lkIjoxLCJmaXJzdGlhdCI6MTc1NDM5Njg3NywiYXV0aHR5cGUiOiJwYXNzd29yZGF1dGgiLCJhcGlrZXl1c2VybmFtZSI6IiIsIm9iamVjdHJlc3RyaWN0aW9uIjoiIiwib3JncmVzdHJpY3Rpb24iOiIiLCJpc3N1ZWRBdFByZWNpc2UiOiIyMDI1LTA4LTA1VDEyOjI3OjU3LjUwODEwOTE3OVoifQ.30GbJmvAFYEYadVBslDZeG9Cg8QwQodSxLXxKruRS9sgSfWTmrXR2DgielNGq6gEm-3qXUxmLffNV3MsX-3hAg
{
"App": {
"key": {
"organization": "edp-developer-framework",
"name": "HelloWorldAuto",
"version": "1.0"
}
},
"Region": "EU"
}
###
POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/auth/ctrl/CreateApp HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTQ0ODMyNzcsImlhdCI6MTc1NDM5Njg3NywidXNlcm5hbWUiOiJyaXJlIiwiZW1haWwiOiJyaWNoYXJkLXJvYmVydC5yZWl0ekB0ZWxla29tLmRlIiwia2lkIjoxLCJmaXJzdGlhdCI6MTc1NDM5Njg3NywiYXV0aHR5cGUiOiJwYXNzd29yZGF1dGgiLCJhcGlrZXl1c2VybmFtZSI6IiIsIm9iamVjdHJlc3RyaWN0aW9uIjoiIiwib3JncmVzdHJpY3Rpb24iOiIiLCJpc3N1ZWRBdFByZWNpc2UiOiIyMDI1LTA4LTA1VDEyOjI3OjU3LjUwODEwOTE3OVoifQ.30GbJmvAFYEYadVBslDZeG9Cg8QwQodSxLXxKruRS9sgSfWTmrXR2DgielNGq6gEm-3qXUxmLffNV3MsX-3hAg
content-type: application/json
{
"App": {
"key": {
"organization": "edp-developer-framework",
"name": "HelloWorldAuto",
"version": "1.0"
},
"image_path": "edp.buildth.ing/devfw-cicd/fibonacci_pipeline:development",
"image_type": "Docker",
"access_ports": "tcp:80",
"default_flavor": {
"name": "EU.small"
},
"deployment": "docker",
"required_outbound_connections": null
},
"Region": "EU"
}
###
POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/auth/ctrl/DeleteApp HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTQ0ODMyNzcsImlhdCI6MTc1NDM5Njg3NywidXNlcm5hbWUiOiJyaXJlIiwiZW1haWwiOiJyaWNoYXJkLXJvYmVydC5yZWl0ekB0ZWxla29tLmRlIiwia2lkIjoxLCJmaXJzdGlhdCI6MTc1NDM5Njg3NywiYXV0aHR5cGUiOiJwYXNzd29yZGF1dGgiLCJhcGlrZXl1c2VybmFtZSI6IiIsIm9iamVjdHJlc3RyaWN0aW9uIjoiIiwib3JncmVzdHJpY3Rpb24iOiIiLCJpc3N1ZWRBdFByZWNpc2UiOiIyMDI1LTA4LTA1VDEyOjI3OjU3LjUwODEwOTE3OVoifQ.30GbJmvAFYEYadVBslDZeG9Cg8QwQodSxLXxKruRS9sgSfWTmrXR2DgielNGq6gEm-3qXUxmLffNV3MsX-3hAg
{
"App": {
"key": {
"organization": "edp-developer-framework",
"name": "HelloWorldAuto",
"version": "1.0"
}
},
"Region": "EU"
}

View file

@ -1,112 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EDP meets Edge Connect</title>
<!--
The following script loads Tailwind CSS, which is used for rapid styling.
The CSS below uses basic selectors to demonstrate how to achieve the
requested layout without relying solely on a framework.
-->
<style>
/* This applies a smooth, rounded border to all elements. */
* {
border-radius: 0.5rem;
}
/*
The body is a flex container to center its child element.
- display: flex makes it a flexible box container.
- justify-content: center centers the child horizontally.
- align-items: center centers the child vertically.
- min-height: 100vh ensures the body takes up the full viewport height.
- background-color: black sets the background color as requested.
- color: magenta sets the text color for the entire body as requested.
*/
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: black;
color: #e20074;
font-family: 'Inter', sans-serif;
margin: 0;
padding: 1rem;
}
/*
This container holds both the image and the text.
- It uses flexbox to arrange the items in a row.
- align-items: center vertically aligns the image and the text.
- The gap adds space between the image and the text.
- max-width prevents the content from stretching too wide on large screens.
- The padding adds some space inside the container.
*/
.content-container {
align-items: center;
flex-wrap: wrap; /* Allows wrapping on smaller screens */
gap: 2rem;
max-width: 90%;
padding: 1.5rem;
text-align: center;
justify-content: center;
}
/*
The image styling.
- max-width ensures the image is responsive.
- height: auto maintains the aspect ratio.
*/
.content-container img {
width: 150px;
height: auto;
}
/*
The text styling.
- font-size: 6rem makes the text very large.
- font-weight: bold makes the text stand out.
- line-height ensures there is enough space around the text.
*/
.content-container h1 {
font-size: clamp(3rem, 10vw, 6rem); /* Responsive font size */
font-weight: bold;
line-height: 1;
margin: 0;
}
/*
This media query adjusts the layout for smaller screens.
- It changes the flex direction to column, stacking the image and text.
- The text alignment is centered.
*/
@media (max-width: 600px) {
.content-container {
flex-direction: column;
}
}
</style>
</head>
<body>
<div class="content-container">
<!--
This is a placeholder image. You should replace the 'src'
attribute with the URL of your own image. The `onerror`
attribute provides a fallback in case the image fails to load.
-->
<img
src="https://edp.buildth.ing/assets/img/logo.svg"
>
<br />
<!-- The main heading text, styled to be large and centered -->
<h1>EDP meets Edge Connect</h1>
</div>
</body>
</html>

View file

@ -1,39 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: edgeconnect-coder-tcp
labels:
run: edgeconnect-coder
spec:
type: LoadBalancer
ports:
- name: tcp80
protocol: TCP
port: 80
targetPort: 80
selector:
run: edgeconnect-coder
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: edgeconnect-coder-deployment
spec:
replicas: 1
selector:
matchLabels:
run: edgeconnect-coder
template:
metadata:
labels:
run: edgeconnect-coder
mexDeployGen: kubernetes-basic
spec:
volumes:
containers:
- name: edgeconnect-coder
image: ###IMAGETAG###
imagePullPolicy: Always
ports:
- containerPort: 80
protocol: TCP