Skip to content

Commit

Permalink
Merge branch 'master' into add-cloud-sdr-deprecation-notice-to-edge-sdr
Browse files Browse the repository at this point in the history
  • Loading branch information
t-fine authored Aug 2, 2022
2 parents 582484f + 1ebd166 commit ce7182f
Show file tree
Hide file tree
Showing 26 changed files with 203 additions and 86 deletions.
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/Other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
name: Other
about: Something else

---

32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Operating Environment:**
- Desktop, Cluster, Cloud, other
- OS, technology stack
- other

**Additional context**
Add any other context about the problem here.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Documentation Update📄
description: Suggest how we can improve our documentation
title: "Documentation📄: "
labels: [documentation]


body:
- type: markdown
attributes:
value: Thank you for taking the time to file a Documentation update report
- type: textarea
attributes:
label: What is the current documentation state?
description: "Copy and paste the text currently in the documentation. If you want to improve graphs or photos, please provide a screenshot of the original."
- type: textarea
attributes:
label: Where is this stated?
description: "Provide additional information about the location where you have copied the above statement from."
- type: textarea
attributes:
label: Why do you want to improve the statement?
description: "Please explain why the statement needs to be updated. This can be because it is confusing, incorrect, spelling/grammatical errors, etc."
- type: textarea
attributes:
label: Proposed Statement
description: "Please propose how you would rewrite the statement. If you have a precise proposal, please make the changes and open a pull request."
- type: textarea
attributes:
label: Additional context.
description: "Add any other context or useful information about the documentation update here."
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Feature Request
description: Suggest an idea for this project
title: "Feature Request: "
labels: [enhancement]

body:
- type: markdown
attributes:
value: Thank you for taking the time to file a Feature Request report.
- type: textarea
attributes:
label: Is your feature request related to a problem? Please describe.
description: 'A clear and concise description of what the problem is. Ex. I am always frustrated when [...]'
- type: textarea
attributes:
label: Describe the solution you'd like.
description: 'A clear and concise description of what you want to happen.'
- type: textarea
attributes:
label: Describe alternatives you've considered
description: 'A clear and concise description of any alternative solutions or features you have considered.'
- type: textarea
attributes:
label: Additional context.
description: 'Add any other context or screenshots about the feature request here.'
41 changes: 41 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Configuration for welcome - https://github.com/behaviorbot/welcome

# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome

# Comment to be posted to on first time issues
newIssueWelcomeComment: |
Hello there!👋 Welcome to Open-Horizon-Examples!💖
Thank you and congratulations 🎉 for opening your very first issue in this project.
Please checkout if any of the already existing issue template fits for your isssue or you may open a blank issue as well ✨
We will try to get back to you as soon as we can.👀
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome

# Comment to be posted to on PRs from first time contributors in your repository
newPRWelcomeComment: |
Hello there!👋 Welcome to Open-Horizon-Examples!💖
Thank you and congrats 🎉 for opening your first PR on this project.✨
We will review it soon! Till then you can checkout the `README.md` for more details on it.
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge

# Comment to be posted to on pull requests merged by a first time user
firstPRMergeComment: |
Congratulations on merging your first contribution to Open-Horizon-Examples!✨
# *Required* Comment to reply with
requestInfoReplyComment: >
Hi,
Thanks for raising an issue/pull request! We at Open-Horizon appreciate your concerns and views to
help us improve.
# *OPTIONAL* default titles to check against for lack of descriptiveness
# MUST BE ALL LOWERCASE
requestInfoDefaultTitles:
- update readme.md
- updates
- add files via upload
- readme.md
- changes made

# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given
requestInfoLabelToAdd: needs-more-info

# It is recommended to include as many gifs and emojis as possible!
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,8 @@ Edge examples specific to the Watson IoT Platform are found in [edge/wiotp](edge
# Using Example Services
Each example service in this repo has a [README](edge/services/helloworld/README.md#horizon-hello-world-example-edge-service) that includes steps to run it when it is currently published in your exchange, or a ["Create your own"](edge/services/helloworld/CreateService.md#creating-your-own-hello-world-edge-service) set of instructions that will guide you through the process of publishing your own version to your exchange.

Contributors

<a href="https://github.com/open-horizon/examples/graphs/contributors">
<img src="https://contrib.rocks/image?repo=open-horizon/examples" />
</a>
2 changes: 2 additions & 0 deletions cloud/sdr/deploy/ibm/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## ALERT: This service is deprecated and no longer being maintained. It will be removed from the master branch soon. You will still be able to find the most recent version in the deprecated_cloud_sdr_example branch or any [open-horizon/examples release](https://github.com/open-horizon/examples/releases) v2.30.0-802 or older.

# sdr-auto

> Deployment automation for SDR PoC cloud part on IBM Cloud
Expand Down
5 changes: 5 additions & 0 deletions cloud/sdr/ui/sdr-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ node_modules
node_modules/
server/config/settings.js
.eslintrc.json

# Eclipse files
.classpath
.project
.settings/
15 changes: 0 additions & 15 deletions cloud/sdr/ui/sdr-app/.project

This file was deleted.

2 changes: 2 additions & 0 deletions cloud/sdr/ui/sdr-app/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# IBM Cloud Node.js Starter App for SDR

:warning: **Note: the `cloud/sdr` backend will be deprecated soon!**

This application demonstrates a simple, reusable Node.js web application based on the Express framework.

---
Expand Down
2 changes: 2 additions & 0 deletions cloud/sdr/ui/sdr-app/client/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
:warning: **Note: the `cloud/sdr` backend will be deprecated soon!**

This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).

Below you will find some information on how to perform common tasks.<br>
Expand Down
27 changes: 0 additions & 27 deletions cloud/sdr/ui/sdr-app/client/src/App.js.old

This file was deleted.

1 change: 0 additions & 1 deletion cloud/sdr/ui/sdr-app/client/src/config/settings.js.bak

This file was deleted.

5 changes: 0 additions & 5 deletions cloud/sdr/ui/sdr-app/server/config/settings.js.bak

This file was deleted.

2 changes: 2 additions & 0 deletions edge/evtstreams/sdr2evtstreams/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Horizon SDR To IBM Event Streams Service

:warning: **Note: the `cloud/sdr` backend will be deprecated soon!**

This example illustrates a more realistic Horizon edge service by including additional aspects of typical edge services.

- [Preconditions for Using the SDR To IBM Event Streams Example Edge Service](#preconditions)
Expand Down
42 changes: 23 additions & 19 deletions edge/services/nginx-operator/CreateService.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,16 @@ The above command will give you an empty ansible operator. At the very least you
```bash
wget https://raw.githubusercontent.com/open-horizon/examples/master/edge/services/nginx-operator/ansible-role-files/deployment.j2 && mv deployment.j2 roles/myoperator/templates/
wget https://raw.githubusercontent.com/open-horizon/examples/master/edge/services/nginx-operator/ansible-role-files/service.j2 && mv service.j2 roles/myoperator/templates/
wget https://raw.githubusercontent.com/open-horizon/examples/master/edge/services/nginx-operator/ansible-role-files/route.j2 && mv route.j2 roles/myoperator/templates/
wget https://raw.githubusercontent.com/open-horizon/examples/master/edge/services/nginx-operator/ansible-role-files/main.yml && mv main.yml roles/myoperator/tasks/
```

3. Build the operator image (use ppc64le for power arch):
3. **FOR OCP EDGE CLUSTERS ONLY:** Obtain the `route`, and modified task file and move them into the `my-operator` roles directory:
```bash
operator-sdk build docker.io/$DOCKER_HUB_ID/my.operator_amd64:1.0.0
docker push docker.io/$DOCKER_HUB_ID/my.operator_amd64:1.0.0
```

4. In the `deploy/operator.yaml` file replace `"REPLACE_IMAGE"` with the operator image name you build and pushed in the previous step (use ppc64le for power arch):
```bash
image: "<docker-hub-id>/my.operator_amd64:1.0.0"
wget https://raw.githubusercontent.com/open-horizon/examples/master/edge/services/nginx-operator/ansible-role-files/route.j2 && mv route.j2 roles/myoperator/templates/
wget https://raw.githubusercontent.com/open-horizon/examples/master/edge/services/nginx-operator/ansible-role-files/main-route.yml && mv main.yml roles/myoperator/tasks/main.yml
```

5. By default the operator does not have the permission to create routes, however, with the following command you can add the lines needed to the `deploy/role.yaml` file so the operator can expose the `nginx` service with a route:
4. **FOR OCP EDGE CLUSTERS ONLY:** By default the operator does not have the permission to create routes, however, with the following command you can add the lines needed to the `deploy/role.yaml` file so the operator can expose the `nginx` service with a route:
```bash
echo "- apiGroups:
- route.openshift.io
Expand All @@ -107,7 +101,18 @@ The above command will give you an empty ansible operator. At the very least you
- delete" >> deploy/role.yaml
```

6. Apply the required resources to run the operator
5. Build the operator image (use ppc64le for power arch):
```bash
operator-sdk build docker.io/$DOCKER_HUB_ID/my.operator_amd64:1.0.0
docker push docker.io/$DOCKER_HUB_ID/my.operator_amd64:1.0.0
```

6. In the `deploy/operator.yaml` file replace `"REPLACE_IMAGE"` with the operator image name you build and pushed in the previous step (use ppc64le for power arch):
```bash
image: "<docker-hub-id>/my.operator_amd64:1.0.0"
```

7. Apply the required resources to run the operator
```bash
kubectl apply -f deploy/crds/my.operator.com_myoperators_crd.yaml
kubectl apply -f deploy/service_account.yaml
Expand All @@ -117,7 +122,7 @@ The above command will give you an empty ansible operator. At the very least you
kubectl apply -f deploy/crds/my.operator.com_v1alpha1_myoperator_cr.yaml
```

7. Ensure the operator pod and the deployed service pod are running:
8. Ensure the operator pod and the deployed service pod are running:
```bash
kubectl get pods
```
Expand All @@ -129,7 +134,7 @@ If everything deployed correctly you should see an output similar to the followi
my-operator-55c6f56c47-b6p7c 1/1 Running 0 48s
```

8. Check that the service is up:
9. Check that the service is up:
```bash
kubectl get service
```
Expand All @@ -141,7 +146,8 @@ If everything deployed correctly you should see an output similar to the followi
```

If you are using an **OCP edge cluster** you will need to `curl` the service using the exposed `route`.
9. Get the exposed route name:

10. Get the exposed route name:
```bash
kubectl get route -n openhorizon-agent
```
Expand All @@ -152,7 +158,7 @@ If the route was exposed correctly you should see an output similar to the follo
nginx-route nginx-route-openhorizon-agent.apps.apollo5.cp.fyre.ibm.com nginx 8080 None
```

10. `curl` the service to test if it is functioning correctly:
11. `curl` the service to test if it is functioning correctly:
**OCP edge cluster** substitute the above `HOST/PORT` value:
```bash
curl nginx-route-openhorizon-agent.apps.apollo5.cp.fyre.ibm.com
Expand Down Expand Up @@ -192,23 +198,21 @@ If the service is running you should see following `Welcome to nginx!` output:
</html>
```

11. Delete the resources to stop your operator pod and service
12. Delete the resources to stop your operator pod and service
```bash
kubectl delete crd myoperators.my.operator.com
kubectl delete deployment my-operator
kubectl delete service my-operator-metrics
kubectl delete serviceaccount my-operator
kubectl delete rolebinding my-operator
kubectl delete role my-operator
kubectl delete route nginx-route
```

**Note:** if any pods are stuck in the `Terminating` state after running the previous commands you can force delete them with the following command:
```bash
kubectl -n <namespace> delete pods --grace-period=0 --force <pod_name(s)>
```

12. Create a tar archive that contains the files inside the operators `deploy/` directory:
13. Create a tar archive that contains the files inside the operators `deploy/` directory:
```
tar -zcvf operator.tar.gz deploy/*
```
Expand Down
2 changes: 1 addition & 1 deletion edge/services/nginx-operator/PatternRegister.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

1. Register your edge node with Horizon to use the `nginx-operator` pattern:
```bash
hzn register -p IBM/pattern-nginx.operator-amd64 -u $HZN_EXCHANGE_USER_AUTH
hzn register -p IBM/pattern-ibm.nginx-operator-amd64 -u $HZN_EXCHANGE_USER_AUTH
```
- **Note**: using the `-s` flag with the `hzn register` command will cause Horizon to wait until agreements are formed and the service is running on your edge node to exit, or alert you of any errors encountered during the registration process.

Expand Down
12 changes: 6 additions & 6 deletions edge/services/nginx-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ In the following steps you will deploy the `nginx-operator` to your edge cluster
```json
{
"mycluster/policy-hello-operator": {
"mycluster/policy-ibm.nginx-operator_1.0.1": {
"owner": "root/root",
"label": "nginx-operator Deployment Policy",
"label": "ibm.nginx-operator Deployment Policy",
"description": "A super-simple sample Horizon Deployment Policy",
"service": {
"name": "nginx-operator",
"name": "ibm.nginx-operator",
"org": "IBM",
"arch": "*",
"serviceVersions": [
{
"version": "1.0.0",
"version": "1.0.1",
"priority": {},
"upgradePolicy": {}
}
Expand All @@ -124,8 +124,8 @@ In the following steps you will deploy the `nginx-operator` to your edge cluster
"constraints": [
"openhorizon.example == nginx-operator"
],
"created": "2020-11-05T19:18:17.722Z[UTC]",
"lastUpdated": "2020-11-05T19:18:17.722Z[UTC]"
"created": "2022-05-12T23:17:04.919499Z[UTC]",
"lastUpdated": "2022-05-12T23:17:04.919489Z[UTC]"
}
}
```
Expand Down
Loading

0 comments on commit ce7182f

Please sign in to comment.