Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[98] remove dependency to oee-bundle #99

Merged
merged 21 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
environment:
type: environment
description: Name of the environment to use
default: "oee-dev"
default: "test"
required: true

jobs:
Expand All @@ -39,7 +39,7 @@ jobs:
release_version: ${{ steps.update-version-number.outputs.release_version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: 'repo'

Expand All @@ -59,9 +59,9 @@ jobs:
docker rmi oee-simulators

- name: Upload file and zip an artifact
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v4
with:
name: 'oee-simulators'
path: |
repo/simulators/image.tar
repo/simulators/cumulocity.json
repo/simulators/cumulocity.json
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
environment:
type: environment
description: Name of the environment to use
default: "oee-dev"
default: "test"
required: true

jobs:
Expand All @@ -30,12 +30,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: 'repo'

- name: Download artifact
uses: actions/download-artifact@v3.0.2
uses: actions/download-artifact@v4
with:
name: 'oee-simulators'
path: 'repo/simulators'
Expand All @@ -55,7 +55,7 @@ jobs:
zip oee-simulators.zip image.tar cumulocity.json

- name: Create Release
uses: actions/create-release@v1.1.4
uses: actions/create-release@v1
id: create_release
with:
draft: false
Expand All @@ -67,11 +67,11 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload oee-sim zip
uses: actions/upload-release-asset@v1.0.2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # upload_url output is provided automatically by the GitHub API when the release is created
asset_path: 'repo/simulators/oee-simulators.zip'
asset_name: 'oee-simulators.zip'
asset_content_type: application/zip
asset_content_type: application/zip
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
environment:
type: environment
description: Name of the environment to use
default: "oee-dev"
default: "test"
required: true

push:
Expand All @@ -31,7 +31,7 @@ env:
jobs:
run-tests:
runs-on: ubuntu-latest
environment: ${{ inputs.environment || 'oee-dev' }} # oee-dev for on.push event
environment: ${{ inputs.environment || 'test' }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand All @@ -40,7 +40,7 @@ jobs:

- name: Check Environment
run:
echo "Running on environment ${{ inputs.environment || 'oee-dev' }}" # oee-dev for on.push event
echo "Running on environment ${{ inputs.environment || 'test' }}"

- name: Run tests
id: tests
Expand All @@ -53,4 +53,4 @@ jobs:
C8Y_BASEURL: ${{ env.C8Y_BASEURL }}
C8Y_PASSWORD: ${{ env.C8Y_PASSWORD }}
C8Y_TENANT: ${{ env.C8Y_TENANT }}
C8Y_USER: ${{ env.C8Y_USER }}
C8Y_USER: ${{ env.C8Y_USER }}
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# OEE-simulators

Collection of simulators available for Cumulocity IoT OEE app. All simulators are available as Docker images and need to be deployed to the tenant where OEE app is running. Once deployed, the simulators automatically create preconfigured devices and start sending data.
Collection of simulators available for [Cumulocity IoT OEE block](https://github.com/Cumulocity-IoT/oee-block). The simulators are available as Docker image and need to be deployed to the tenant where OEE block is running. Once deployed, the simulators automatically create preconfigured devices and start sending data.

[Generic Simulators](simulators) are the simulators we do use for development and should be used for testing and demoing of Cumulocity IoT OEE app. The simulators have been designed and configured to simulate commonly seen machine types. A detailed description of [supported machine types](simulators/simulators.md) and [how to configure calculation profiles](simulators/simulators.md#oee-profile-settings-for-simulators) in OEE app can be found in the [simulators](simulators) project.
[Generic Simulators](simulators) are the simulators can be used for testing and demoing the Cumulocity IoT OEE block. The simulators have been designed and configured to simulate commonly seen machine types. A detailed description of the [supported machine types](simulators/simulators.md) can be found in the [simulators](simulators) folder.

Simulators are needed to calculate OEE based on configuration profiles that can be setup in OEE app.

Prebuilt docker images can be downloaded from the [Releases](https://github.softwareag.com/IOTA/oee-simulators/releases) in this repository.
The prebuilt docker images can be downloaded from the [Releases](https://github.com/Cumulocity-IoT/oee-simulators/releases) in this repository.

# Tests
Collection of test for the [Generic Simulators](simulators)

To run specific test script:
To run specific a test script:
```
python test/[script-name].py [-h] [--tenant-id TENANT_ID] [--password PASSWORD] [--baseurl BASEURL] [--username USER]
```
Expand All @@ -31,7 +29,7 @@ It is important to note that <strong><ins>all four arguments: Tenant ID, C8Y Pas
Failure to provide any of these fields may cause the script to malfunction or produce unexpected results.
</pre>

If you don't want to input arguments, you can set environment variables need to be set in [cumulocityAPI.py](simulators/main/cumulocityAPI.py) in order to run [simulators_test.py](test/simulators_test.py). <br>
If you don't want to input arguments, you can set environment variables. They need to be set in [cumulocityAPI.py](simulators/main/cumulocityAPI.py) in order to run [simulators_test.py](test/simulators_test.py). <br>
For example:
```
C8Y_BASEURL=https://test.development.c8y.io
Expand All @@ -40,10 +38,10 @@ C8Y_USER=yourusername
C8Y_PASSWORD=yourpassword
```

If you run the [export_import_test.py](test/export_import_test.py), besides environment variables in [cumulocityAPI.py](main/cumulocityAPI.py), you must set environment variables also in [Environment.py](simulators/extras/Environment.py).
If you run the [export_import_test.py](test/export_import_test.py), besides environment variables in [cumulocityAPI.py](simulators/main/cumulocityAPI.py), you must set environment variables also in [Environment.py](simulators/extras/Environment.py).
Because they use both [extra](simulators/extras) and [main](simulators/main) parts of simulators which are independent to each other.
<br>

------------------------------

These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.
These tools are provided as-is and without warranty or support. They do not constitute part of the Cumulocity GmbH product suite. Users are free to use, fork and modify them, subject to the license agreement. While Cumulocity GmbH welcomes contributions, we cannot guarantee to include every contribution in the master project.
60 changes: 0 additions & 60 deletions simulators/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,66 +9,6 @@
"envFile": "${workspaceFolder}/.vscode/.env",
"cwd": "${workspaceFolder}/main/",
"console": "integratedTerminal"
},
{
"name": "create profiles",
"type": "python",
"request": "launch",
"program": "profile_generator.py",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.vscode/.env",
"cwd": "${workspaceFolder}/main/",
"args": [
"--create-profiles"
]
},
{
"name": "remove simulator profiles via OEE API",
"type": "python",
"request": "launch",
"program": "profile_generator.py",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.vscode/.env",
"cwd": "${workspaceFolder}/main/",
"args": [
"--remove-simulator-profiles-via-oee"
]
},
{
"name": "delete simulator profiles",
"type": "python",
"request": "launch",
"program": "profile_generator.py",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.vscode/.env",
"cwd": "${workspaceFolder}/main/",
"args": [
"--delete-simulator-profiles"
]
},
{
"name": "create calculation categories",
"type": "python",
"request": "launch",
"program": "profile_generator.py",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.vscode/.env",
"cwd": "${workspaceFolder}/main/",
"args": [
"--create-categories"
]
},
{
"name": "delete calculation categories",
"type": "python",
"request": "launch",
"program": "profile_generator.py",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.vscode/.env",
"cwd": "${workspaceFolder}/main/",
"args": [
"--delete-categories"
]
}
]
}
3 changes: 0 additions & 3 deletions simulators/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@ WORKDIR /home/appuser

USER appuser

ARG ARG_CREATE_PROFILES
ENV CREATE_PROFILES ${ARG_CREATE_PROFILES:-false}

CMD [ "python", "./simulator.py" ]
Loading
Loading