Skip to content

Commit

Permalink
313 dockter 1 (#316)
Browse files Browse the repository at this point in the history
* #313 Update dependencies

* #313 Migrate g2 to er/sz

* #313 Savepoint

* #313 Working on developement documentation

* #313 Working on developement documentation

* #313 Working on developement documentation

* #313 Update documentation

* #313 Update documentation

* #313 Update documentation

* #313 Update documentation

* Force re-test
  • Loading branch information
docktermj authored Aug 23, 2024
1 parent 10ede88 commit 8a53c92
Show file tree
Hide file tree
Showing 39 changed files with 424 additions and 455 deletions.
66 changes: 33 additions & 33 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ When issues are opened,
this action adds appropriate labels to the issue.
(e.g. "triage", "customer-submission")

- [Add Labels Standardized GitHub action]
- [Add Labels Standardized GitHub Action]
- Uses: [senzing-factory/build-resources/.../add-labels-to-issue.yaml]

## add-to-project-garage-dependabot.yaml

When a Dependabot Pull Request (PR) is made against `main` branch,
this action adds the PR to the "Garage" project board as "In Progress".

- [Add to Project Garage Dependabot GitHub action]
- [Add to Project Garage Dependabot GitHub Action]
- Uses: [senzing-factory/build-resources/.../add-to-project-dependabot.yaml]

## add-to-project-garage.yaml

When an issue is created,
this action adds the issue to the "Garage" board as "Backlog".

- [Add to Project Garage GitHub action]
- [Add to Project Garage GitHub Action]
- Uses: [senzing-factory/build-resources/.../add-to-project.yaml]

## dependabot-approve-and-merge.yaml
Expand All @@ -31,33 +31,33 @@ When a Dependabot Pull Request (PR) is made against the `main` branch,
this action determines if it should be automatically approved and merged into the `main` branch.
Once this action occurs [move-pr-to-done-dependabot.yaml] moves the PR on the "Garage" project board to "Done".

- [Dependabot Approve and Merge GitHub action]
- [Dependabot Approve and Merge GitHub Action]
- Uses: [senzing-factory/build-resources/.../dependabot-approve-and-merge.yaml]

## docker-build-container.yaml

When a Pull Request is made against the `main` branch,
this action verifies that the `Dockerfile` can be successfully built.

*Note:* The Docker image is **not** pushed to [DockerHub].
_Note:_ The Docker image is **not** pushed to [DockerHub].

- [Docker Build Container GitHub action]
- [Docker Build Container GitHub Action]
- Uses: [senzing-factory/github-action-docker-buildx-build]

## docker-push-containers-to-dockerhub.yaml

After a [Semantic Version] release is created,
this action builds Docker images on multiple architectures and pushes the Docker images to [DockerHub].

- [Docker Push Containers to DockerHub GitHub action]
- [Docker Push Containers to DockerHub GitHub Action]
- Uses: [senzing-factory/github-action-docker-buildx-build]

## golangci-lint.yaml

When a change is committed to GitHub or a Pull Request is made against the `main` branch,
this action runs [golangci-lint] to run multiple linters against the code.

- [Golangci Lint GitHub action]
- [Golangci Lint GitHub Action]
- Configuration:
- [.golangci.yaml]
- Uses:
Expand All @@ -71,15 +71,15 @@ this action runs [golangci-lint] to run multiple linters against the code.
After a [Semantic Version] release is created,
this action expedites the Go publishing process.

- [Go Proxy Pull GitHub action]
- [Go Proxy Pull GitHub Action]
- Uses: [andrewslotin/go-proxy-pull-action]

## go-test-darwin.yaml

When a Pull Request is made against the `main` branch,
this action runs `go test` with coverage testing on macOS.

- [Go Test Darwin GitHub action]
- [Go Test Darwin GitHub Action]
- Configuration: [testcoverage.yaml]
- Uses:
- [actions/checkout]
Expand All @@ -94,7 +94,7 @@ this action runs `go test` with coverage testing on macOS.
When a change is committed to GitHub or a Pull Request is made against the `main` branch,
this action runs `go test` with coverage testing on Linux.

- [Go Test Linux GitHub action]
- [Go Test Linux GitHub Action]
- Configuration: [testcoverage.yaml]
- Uses:
- [actions/checkout]
Expand All @@ -109,7 +109,7 @@ this action runs `go test` with coverage testing on Linux.
When a Pull Request is made against the `main` branch,
this action runs `go test` with coverage testing on Windows.

- [Go Test Windows GitHub action]
- [Go Test Windows GitHub Action]
- Configuration: [testcoverage.yaml]
- Uses:
- [actions/checkout]
Expand All @@ -124,7 +124,7 @@ this action runs `go test` with coverage testing on Windows.
When a change is committed to GitHub or a Pull Request is made against the `main` branch,
this action runs [super-linter] to run multiple linters against the code.

- [Lint Workflows GitHub action]
- [Lint Workflows GitHub Action]
- Configuration:
- [.checkov.yaml]
- [.jscpd.json]
Expand All @@ -137,7 +137,7 @@ After a [Semantic Version] release is created,
this action creates a Pull Request for an updated [github.go] file
for the **next** Semantic Version release by increasing the Semantic Version's Patch value.

- [Make Go GitHub File GitHub action]
- [Make Go GitHub File GitHub Action]
- Uses: [senzing-factory/build-resources/.../make-go-github-file.yaml]

## make-go-tag.yaml
Expand All @@ -146,7 +146,7 @@ After a [Semantic Version] release is created,
this action creates a tag in the form `vM.m.P` using the SHA of the `M.m.P` release.
The `v` prefix is standard usage in [Go].

- [Make Go Tag GitHub action]
- [Make Go Tag GitHub Action]
- Uses:
- [actions/checkout]
- [senzing-factory/github-action-make-go-tag]
Expand All @@ -156,38 +156,38 @@ The `v` prefix is standard usage in [Go].
When a Pull Request is merged into the `main` branch,
this action moves the PR on the "Garage" project board to "Done".

- [Move PR to Done Dependabot GitHub action]
- [Move PR to Done Dependabot GitHub Action]
- Uses: [senzing-factory/build-resources/.../move-pr-to-done-dependabot.yaml]

[.checkov.yaml]: ../linters/README.md#checkovyaml
[.checkov.yaml]: ../linters/README.md#checkovyaml
[.golangci.yaml]: ../linters/README.md#golangciyaml
[.jscpd.json]: ../linters/README.md#jscpdjson
[.yaml-lint.yml]: ../linters/README.md#yaml-lintyml
[actions/checkout]: https://github.com/actions/checkout
[actions/setup-go]: https://github.com/actions/setup-go
[actions/upload-artifact]: https://github.com/actions/upload-artifact
[Add Labels Standardized GitHub action]: add-labels-standardized.yaml
[Add to Project Garage Dependabot GitHub action]: add-to-project-garage-dependabot.yaml
[Add to Project Garage GitHub action]: add-to-project-garage.yaml
[Add Labels Standardized GitHub Action]: add-labels-standardized.yaml
[Add to Project Garage Dependabot GitHub Action]: add-to-project-garage-dependabot.yaml
[Add to Project Garage GitHub Action]: add-to-project-garage.yaml
[andrewslotin/go-proxy-pull-action]: https://github.com/andrewslotin/go-proxy-pull-action
[Dependabot Approve and Merge GitHub action]: dependabot-approve-and-merge.yaml
[Docker Build Container GitHub action]: docker-build-container.yaml
[Docker Push Containers to DockerHub GitHub action]: docker-push-containers-to-dockerhub.yaml
[Dependabot Approve and Merge GitHub Action]: dependabot-approve-and-merge.yaml
[Docker Build Container GitHub Action]: docker-build-container.yaml
[Docker Push Containers to DockerHub GitHub Action]: docker-push-containers-to-dockerhub.yaml
[DockerHub]: https://hub.docker.com/
[github.go]: ../../cmd/github.go
[Go Proxy Pull GitHub action]: go-proxy-pull.yaml
[Go Test Darwin GitHub action]: go-test-darwin.yaml
[Go Test Linux GitHub action]: go-test-linux.yaml
[Go Test Windows GitHub action]: go-test-windows.yaml
[Go Proxy Pull GitHub Action]: go-proxy-pull.yaml
[Go Test Darwin GitHub Action]: go-test-darwin.yaml
[Go Test Linux GitHub Action]: go-test-linux.yaml
[Go Test Windows GitHub Action]: go-test-windows.yaml
[Go]: https://go.dev/
[Golangci Lint GitHub action]: golangci-lint.yaml
[Golangci Lint GitHub Action]: golangci-lint.yaml
[golangci-lint]: https://github.com/golangci/golangci-lint
[golangci/golangci-lint-action]: https://github.com/golangci/golangci-lint-action
[gotesttools/gotestfmt-action]: https://github.com/gotesttools/gotestfmt-action
[Lint Workflows GitHub action]: lint-workflows.yaml
[Make Go GitHub File GitHub action]: make-go-github-file.yaml
[Make Go Tag GitHub action]: make-go-tag.yaml
[Move PR to Done Dependabot GitHub action]: move-pr-to-done-dependabot.yaml
[Lint Workflows GitHub Action]: lint-workflows.yaml
[Make Go GitHub File GitHub Action]: make-go-github-file.yaml
[Make Go Tag GitHub Action]: make-go-tag.yaml
[Move PR to Done Dependabot GitHub Action]: move-pr-to-done-dependabot.yaml
[move-pr-to-done-dependabot.yaml]: move-pr-to-done-dependabotyaml
[Semantic Version]: https://semver.org/
[senzing-factory/build-resources/.../add-labels-to-issue.yaml]: https://github.com/senzing-factory/build-resources/blob/main/.github/workflows/add-labels-to-issue.yaml
Expand All @@ -202,4 +202,4 @@ this action moves the PR on the "Garage" project board to "Done".
[senzing-factory/github-action-install-senzing-api]: https://github.com/senzing-factory/github-action-install-senzing-api
[senzing-factory/github-action-make-go-tag]: https://github.com/senzing-factory/github-action-make-go-tag
[super-linter]: https://github.com/super-linter/super-linter
[testcoverage.yaml]: ../coverage/README.md#testcoverageyaml
[testcoverage.yaml]: ../coverage/README.md#testcoverageyaml
6 changes: 3 additions & 3 deletions .github/workflows/go-test-darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Go test darwin
on: [pull_request, workflow_dispatch]

env:
DYLD_LIBRARY_PATH: /opt/senzing/g2/lib:/opt/senzing/g2/lib/macos
LD_LIBRARY_PATH: /opt/senzing/g2/lib:/opt/senzing/g2/lib/macos
DYLD_LIBRARY_PATH: /opt/senzing/er/lib:/opt/senzing/er/lib/macos
LD_LIBRARY_PATH: /opt/senzing/er/lib:/opt/senzing/er/lib/macos
SENZING_LOG_LEVEL: TRACE
SENZING_TOOLS_DATABASE_URL: sqlite3://na:na@nowhere/tmp/sqlite/G2C.db

Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
senzingapi-version: ${{ matrix.senzingapi-version }}

- name: Copy /etc files
run: sudo mkdir -p /opt/senzing/g2/etc && sudo cp testdata/senzing-license/g2.lic /opt/senzing/g2/etc/g2.lic
run: sudo mkdir -p /opt/senzing/er/etc && sudo cp testdata/senzing-license/g2.lic /opt/senzing/er/etc/g2.lic

- name: Copy test database files
run: mkdir -p /tmp/sqlite && cp testdata/sqlite/G2C.db /tmp/sqlite/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-test-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Go test linux
on: [push]

env:
LD_LIBRARY_PATH: /opt/senzing/g2/lib
LD_LIBRARY_PATH: /opt/senzing/er/lib
SENZING_LOG_LEVEL: TRACE
SENZING_TOOLS_DATABASE_URL: sqlite3://na:na@nowhere/tmp/sqlite/G2C.db

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go-test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
senzingapi-version: ${{ matrix.senzingapi-version }}

- name: Add to "Path" environment variable
run: echo "C:\Program Files\Senzing\g2\lib" | Out-File -FilePath "$env:GITHUB_PATH" -Encoding utf8 -Append
run: printf "C:\Program Files\Senzing\er\lib" | Out-File -FilePath "$env:GITHUB_PATH" -Encoding utf8 -Append

- name: Copy /etc files
run: copy testdata/senzing-license/g2.lic "C:\Program Files\Senzing\g2\etc\g2.lic"
run: copy testdata/senzing-license/g2.lic "C:\Program Files\Senzing\er\etc\g2.lic"

- name: Copy test database files
run: mkdir "C:\Temp\sqlite" && copy testdata/sqlite/G2C.db "C:\Temp\sqlite\G2C.db"
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ jobs:
- name: Copy Senzing headers
run: |
mkdir --parents ./szconfig/gohelpers
cp /opt/senzing/g2/sdk/c/*.h ./szconfig/
cp /opt/senzing/g2/sdk/c/gohelpers/*.h ./szconfig/gohelpers
cp /opt/senzing/er/sdk/c/*.h ./szconfig/
cp /opt/senzing/er/sdk/c/gohelpers/*.h ./szconfig/gohelpers
mkdir --parents ./szconfigmanager/gohelpers
cp /opt/senzing/g2/sdk/c/*.h ./szconfigmanager/
cp /opt/senzing/g2/sdk/c/gohelpers/*.h ./szconfigmanager/gohelpers
cp /opt/senzing/er/sdk/c/*.h ./szconfigmanager/
cp /opt/senzing/er/sdk/c/gohelpers/*.h ./szconfigmanager/gohelpers
mkdir --parents ./szdiagnostic/gohelpers
cp /opt/senzing/g2/sdk/c/*.h ./szdiagnostic/
cp /opt/senzing/g2/sdk/c/gohelpers/*.h ./szdiagnostic/gohelpers
cp /opt/senzing/er/sdk/c/*.h ./szdiagnostic/
cp /opt/senzing/er/sdk/c/gohelpers/*.h ./szdiagnostic/gohelpers
mkdir --parents ./szengine/gohelpers
cp /opt/senzing/g2/sdk/c/*.h ./szengine/
cp /opt/senzing/g2/sdk/c/gohelpers/*.h ./szengine/gohelpers
cp /opt/senzing/er/sdk/c/*.h ./szengine/
cp /opt/senzing/er/sdk/c/gohelpers/*.h ./szengine/gohelpers
mkdir --parents ./szproduct/gohelpers
cp /opt/senzing/g2/sdk/c/*.h ./szproduct/
cp /opt/senzing/g2/sdk/c/gohelpers/*.h ./szproduct/gohelpers
cp /opt/senzing/er/sdk/c/*.h ./szproduct/
cp /opt/senzing/er/sdk/c/gohelpers/*.h ./szproduct/gohelpers
- name: Setup go
uses: actions/setup-go@v5
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

-

## [0.8.0] - 2024-08-23

### Changed in 0.8.0

- Change from `g2` to `sz`/`er`

## [0.7.7] - 2024-08-12

### Changed in 0.7.7
Expand Down
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ COPY . ${GOPATH}/src/serve-grpc

# Copy files from prior stage.

COPY --from=senzingapi_runtime "/opt/senzing/g2/lib/" "/opt/senzing/g2/lib/"
COPY --from=senzingapi_runtime "/opt/senzing/g2/sdk/c/" "/opt/senzing/g2/sdk/c/"
COPY --from=senzingapi_runtime "/opt/senzing/er/lib/" "/opt/senzing/er/lib/"
COPY --from=senzingapi_runtime "/opt/senzing/er/sdk/c/" "/opt/senzing/er/sdk/c/"

# Set path to Senzing libs.

ENV LD_LIBRARY_PATH=/opt/senzing/g2/lib/
ENV LD_LIBRARY_PATH=/opt/senzing/er/lib/

# Build go program.

Expand Down Expand Up @@ -68,6 +68,9 @@ COPY ./rootfs /
# Copy files from prior stage.

COPY --from=builder "/output/linux/serve-grpc" "/app/serve-grpc"

# Install database

COPY ./testdata/sqlite/G2C.db /tmp/sqlite/G2C.db
RUN chmod --recursive 777 /tmp/sqlite

Expand All @@ -78,6 +81,7 @@ USER 1001
# Runtime environment variables.

ENV SENZING_TOOLS_DATABASE_URL=sqlite3://na:na@nowhere/tmp/sqlite/G2C.db
ENV LD_LIBRARY_PATH=/opt/senzing/er/lib/

# Runtime execution.

Expand Down
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ GO_ARCH = $(word 2, $(GO_OSARCH))

# Conditional assignment. ('?=')
# Can be overridden with "export"
# Example: "export LD_LIBRARY_PATH=/path/to/my/senzing/g2/lib"
# Example: "export LD_LIBRARY_PATH=/path/to/my/senzing/er/lib"

# DOCKER_BUILDKIT ?= DOCKER_BUILDKIT=0
DOCKER_IMAGE_TAG ?= $(GIT_REPOSITORY_NAME):$(GIT_VERSION)
GOBIN ?= $(shell go env GOPATH)/bin
LD_LIBRARY_PATH ?= /opt/senzing/g2/lib
SENZING_TOOLS_DATABASE_URL ?= sqlite3://na:na@nowhere/tmp/sqlite/G2C.db
LD_LIBRARY_PATH ?= /opt/senzing/er/lib

# Export environment variables.

Expand Down Expand Up @@ -209,7 +207,7 @@ help:
print-make-variables:
@$(foreach V,$(sort $(.VARIABLES)), \
$(if $(filter-out environment% default automatic, \
$(origin $V)),$(warning $V=$($V) ($(value $V)))))
$(origin $V)),$(info $V=$($V) ($(value $V)))))


.PHONY: update-pkg-cache
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Senzing SDKs for accessing the gRPC server:
A simple demonstration using `senzing-tools` and a SQLite database.

```console
export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
export LD_LIBRARY_PATH=/opt/senzing/er/lib/
export SENZING_TOOLS_DATABASE_URL=sqlite3://na:na@nowhere/tmp/sqlite/G2C.db
senzing-tools init-database
senzing-tools serve-grpc --enable-all
Expand All @@ -57,7 +57,7 @@ senzing-tools serve-grpc --enable-all
## Use

```console
export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
export LD_LIBRARY_PATH=/opt/senzing/er/lib/
senzing-tools serve-grpc [flags]
```

Expand All @@ -66,7 +66,7 @@ senzing-tools serve-grpc [flags]
1. Runtime documentation:

```console
export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
export LD_LIBRARY_PATH=/opt/senzing/er/lib/
senzing-tools serve-grpc --help
```

Expand All @@ -78,7 +78,7 @@ senzing-tools serve-grpc [flags]
Example:

```console
export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
export LD_LIBRARY_PATH=/opt/senzing/er/lib/
senzing-tools serve-grpc \
--database-url postgresql://username:password@postgres.example.com:5432/G2 \
--enable-all
Expand All @@ -93,7 +93,7 @@ senzing-tools serve-grpc [flags]
Example:

```console
export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
export LD_LIBRARY_PATH=/opt/senzing/er/lib/
export SENZING_TOOLS_DATABASE_URL=postgresql://username:password@postgres.example.com:5432/G2
export SENZING_TOOLS_ENABLE_ALL=true
senzing-tools serve-grpc
Expand Down
2 changes: 1 addition & 1 deletion bin/macos_exec_dyld.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/zsh

export DYLD_LIBRARY_PATH=/opt/senzing/g2/lib:/opt/senzing/g2/lib/macos
export DYLD_LIBRARY_PATH=/opt/senzing/er/lib:/opt/senzing/er/lib/macos
export LD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}

"$@"
2 changes: 1 addition & 1 deletion cmd/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
The cmd package is used for Cobra integration.
Package cmd is used for Cobra and Viper integration.
*/
package cmd
Loading

0 comments on commit 8a53c92

Please sign in to comment.