Skip to content

Commit a5f3aa9

Browse files
authored
Updated snippet runners to find new data directory and updated README.md files for SENZING_PATH (#28)
* Updated snippet runners to find new data directory and updated README.md's for SENZING_PATH * Updated github workflows for the new senzing data path and defaults * Added SENZING_PATH back in for the pom.xml dependency location of the sz-sdk.jar file * Fix for java-darwin-snippets.yaml SENZING_PATH value
1 parent 84c116d commit a5f3aa9

File tree

11 files changed

+613
-336
lines changed

11 files changed

+613
-336
lines changed

.github/workflows/csharp-darwin-snippets.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ jobs:
3131

3232
- name: configure environment
3333
run: |
34-
SENZING_DIR="${HOME}/senzing/er"
34+
SENZING_PATH="${HOME}/senzing"
3535
{
36-
echo "SENZING_DIR=${SENZING_DIR}"
37-
echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib"
36+
echo "DYLD_LIBRARY_PATH=${SENZING_PATH}/er/lib"
3837
} >> "$GITHUB_ENV"
3938
4039
- name: configure local nuget repo

.github/workflows/csharp-windows-snippets.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ jobs:
4141
4242
- name: Add to "Path" environment variable
4343
run: |
44-
Add-Content $env:GITHUB_PATH "$Env:USERPROFILE\Senzing\er\lib"
44+
Add-Content $env:GITHUB_PATH "$Env:USERPROFILE\senzing\er\lib"
4545
4646
- name: run csharp snippets
4747
run: |
48-
$Env:SENZING_DIR = "$Env:USERPROFILE\Senzing\er"
4948
cd ${Env:GITHUB_WORKSPACE}/csharp/runner
5049
dotnet run --project SnippetRunner all

.github/workflows/java-darwin-snippets.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333

3434
- name: configure environment
3535
run: |
36-
SENZING_DIR="${HOME}/senzing/er"
36+
SENZING_PATH="${HOME}/senzing"
3737
{
38-
echo "SENZING_DIR=${SENZING_DIR}"
39-
echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib:${SENZING_DIR}/lib/macos"
38+
echo "SENZING_PATH=${SENZING_PATH}"
39+
echo "DYLD_LIBRARY_PATH=${SENZING_PATH}/er/lib:${SENZING_PATH}/er/lib/macos"
4040
} >> "$GITHUB_ENV"
4141
4242
- name: build with Maven

.github/workflows/java-linux-snippets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
- name: build with Maven
4141
env:
42-
SENZING_DIR: "/opt/senzing/er"
42+
SENZING_PATH: "/opt/senzing"
4343
run: |
4444
cd "${GITHUB_WORKSPACE}"/java
4545
mvn clean package

.github/workflows/java-windows-snippets.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ jobs:
3333

3434
- name: build with Maven
3535
run: |
36-
$Env:SENZING_DIR = "$Env:USERPROFILE\Senzing\er"
36+
$Env:SENZING_PATH = "$Env:USERPROFILE\senzing"
3737
cd "${Env:GITHUB_WORKSPACE}/java"
3838
mvn clean install
3939
4040
- name: Add to "Path" environment variable
4141
run: |
42-
Add-Content $env:GITHUB_PATH "$Env:USERPROFILE\Senzing\er\lib"
42+
Add-Content $env:GITHUB_PATH "$Env:USERPROFILE\senzing\er\lib"
4343
4444
- name: run java snippets
4545
run: |
4646
cd "${Env:GITHUB_WORKSPACE}/java"
47-
java "-Dsenzing.install.dir=$Env:USERPROFILE\Senzing\er" -jar target/sz-sdk-snippets.jar all
47+
java -jar target/sz-sdk-snippets.jar all

csharp/README.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@ Before attempting to build the snippets you will need to make the make the
99
`Senzing.Sdk.[version].nupkg` file available to the `dotnet` executable so
1010
it can be used as a dependency. This is done via these [instructions](https://github.com/senzing-garage/sz-sdk-csharp/blob/main/README.md#Usage).
1111

12+
Further, you will need to set environment variables so the Senzing installation can be located:
13+
14+
- Linux:
15+
16+
```console
17+
export SENZING_PATH=/opt/senzing/
18+
export LD_LIBRARY_PATH=$SENZING_PATH/er/lib:$LD_LIBRARY_PATH
19+
```
20+
21+
- macOS:
22+
23+
```console
24+
export SENZING_PATH=$HOME/senzing
25+
export DYLD_LIBRARY_PATH=$SENZING_PATH/er/lib:$SENZING_PATH/er/lib/macos:$DYLD_LIBRARY_PATH
26+
```
27+
28+
- Windows:
29+
30+
```console
31+
set SENZING_PATH=%USERPROFILE%\senzing
32+
set Path=%SENZING_PATH%\er\lib;%Path%
33+
```
34+
1235
## Building
1336

1437
The C# snippets can built using the `dotnet build [project-name]` command under each directory. They can be run using `dotnet run --project [project-name]` command. Attempting to run a snippet will also trigger building it.
@@ -23,22 +46,21 @@ You may run any individual Snippet class directly providing you have a Senzing r
2346

2447
1. Run a snippet that takes no command-line arguments.
2548

26-
```[shell]
49+
```console
2750
cd snippets
2851
dotnet run --project loading/LoadRecords
2952
```
3053

3154
2. Run a snippet and override the input file using command-line arguments
3255

33-
```[shell]
56+
```console
3457
dotnet run --project loading/LoadRecordsViaLoop ../../resources/data/load-500-with-errors.jsonl
3558
```
3659

3760
### Run via Runner
3861

3962
The `SnippetRunner` project will run one or more snippets for you and create a temporary Senzing repository to run then against. This can be executed using:
40-
41-
```[shell]
63+
```console
4264
cd runner
4365
dotnet run --project SnippetRunner
4466
```
@@ -47,42 +69,42 @@ The `SnippetRunner` project will run one or more snippets for you and create a t
4769

4870
1. Execute all code snippets:
4971

50-
```[shell]
72+
```console
5173
cd runner
5274
dotnet run --project SnippetRunner all
5375
```
5476

5577
2. Execute all code snippets in a group:
5678

57-
```[shell]
79+
```console
5880
cd runner
5981
dotnet run --project SnippetRunner loading
6082
```
6183

6284
3. Execute all code snippets from multiple groups:
6385

64-
```[shell]
86+
```console
6587
cd runner
6688
dotnet run --project SnippetRunner loading redo
6789
```
6890

6991
4. Execute specific code snippets:
7092

71-
```[shell]
93+
```console
7294
cd runner
7395
dotnet run --project SnippetRunner loading.LoadViaLoop loading.LoadViaQueue
7496
```
7597

7698
5. Mix and match packages with individual snippets:
7799

78-
```[shell]
100+
```console
79101
cd runner
80102
dotnet run --project SnippetRunner redo loading.LoadViaLoop
81103
```
82104

83105
6. Generate a help message by specifying no arguments:
84106

85-
```[shell]
107+
```console
86108
cd runner
87109
dotnet run --project SnippetRunner
88110

0 commit comments

Comments
 (0)