Skip to content

Commit

Permalink
Merge pull request #1 from Kurrawong/lawson/azure-func
Browse files Browse the repository at this point in the history
lawson/azure func
  • Loading branch information
lalewis1 authored Oct 29, 2024
2 parents c4816b8 + 5c3a46a commit 2aabb07
Show file tree
Hide file tree
Showing 24 changed files with 390 additions and 1,091 deletions.
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

4 changes: 0 additions & 4 deletions .env-template

This file was deleted.

Empty file added .funcignore
Empty file.
60 changes: 0 additions & 60 deletions .github/workflows/release.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

11 changes: 0 additions & 11 deletions .idea/gswa-rdf-delta-consumer.iml

This file was deleted.

61 changes: 0 additions & 61 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11.9
10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
# GSWA RDF Delta Consumer

This Azure Service Bus consumer consumes from a "sessionful" topic, processes the messages (RDF, RDF Patch Log or SPARQL Update queries) and sends it to either the RDF Delta Server or Fuseki SPARQL Update endpoint.
This function consumes from a "sessionful" service bus topic, processes a message
(RDF, RDF Patch Log or SPARQL Update queries) and sends it to the RDF Delta Server or Fuseki SPARQL Update endpoint.

In a future iteration, it will integrate with Olis and do some message processing before sending it off to the target services.
In a future iteration, it will integrate with Olis and do some message processing before sending it off to the target services.

This repository should be deployed as an azure function app.

> [!NOTE]
> The function_app.py script contains the code from https://github.com/Kurrawong/rdf-delta-python/
> because that package has a dependency on python 3.12 but function apps only support up
> to 3.11. It may be better in the future to modify the dependency of rdf-delta-python
> to allow 3.11, and then the package can be pip installed instead of duplicating its code here.
> I have tested locally and it works fine. Not a huge issue as it is only a small amount
> of code.
## Deployment

Deployment can be done from the command line using the
[azure-functions-core-tools](https://github.com/Azure/azure-functions-core-tools) library.

To deploy you need to have created a function app and then run the following command:

```bash
func azure functionapp fetch-app-settings <app_name>
func azure functionapp publish <app_name>
```

After deployment you then need to set the below configuration options and restart the
app.

### Configuration

The following environment variables need to be set on the azure function app.

| variable | example value | description |
| -------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| SERVICE_BUS | Endpoint=sb.//... | service bus connection string |
| TOPIC_NAME | my-topic | name of service bus topic |
| SUBSCRIPTION_NAME | my-sub | name of service bus subscription |
| SESSION_ID | main | service bus session identifier. needs to be the same value as set <br> in the `SHUI_SERVICE_BUS__SESSION_ID` variable in #137 |
| RDF_DELTA_URL | https://myrdfdeltaserver.azurewebsites.net | url for rdf delta server |
| RDF_DELTA_DATASOURCE | myds | datasource name to submit patch logs to in rdf delta server |

## Local Development

You can run the app locally by calling

```bash
func start
```

### Local configuration

Refer to [this article](https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=linux%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&pivots=programming-language-python#local-settings)
for information about configuring local app settings.
16 changes: 0 additions & 16 deletions Taskfile.yml

This file was deleted.

Loading

0 comments on commit 2aabb07

Please sign in to comment.