Skip to content

Commit

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

* #264 Migrage from g2 to sz/er

* #264 Normalize to template

* #264 Improve documentation

* #264 Improve documentation

* #264 Improve documentation

* #264 Improve documentation

* #264 Prepare for versioned release

* Force re-test
  • Loading branch information
docktermj authored Aug 29, 2024
1 parent 819d77e commit df88804
Show file tree
Hide file tree
Showing 36 changed files with 401 additions and 402 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: docker push containers to dockerhub and ecr
name: Docker push containers to dockerhub and ecr

on:
push:
Expand Down
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_TOOLS_DATABASE_URL: sqlite3://na:na@nowhere/tmp/sqlite/G2C.db

permissions:
Expand Down
11 changes: 9 additions & 2 deletions .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 Expand Up @@ -36,14 +36,21 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Copy /opt/senzing/g2/resources/ files
- name: Copy /opt/senzing/er/resources/ files
run: sudo cp --verbose --recursive rootfs/* /

- name: Install Senzing API
uses: senzing-factory/github-action-install-senzing-api@v3
with:
senzingapi-runtime-version: ${{ matrix.senzingapi-version }}

- name: install senzingapi-setup
run: |
sudo SENZING_ACCEPT_EULA=I_ACCEPT_THE_SENZING_EULA apt-get -y install senzingapi-setup
sudo apt list | grep senzing
owner="$(whoami)"
sudo chown -R "${owner}":"${owner}" /opt/senzing
- name: Run go test
run: go test -json -v -p 1 -coverprofile=./cover.out -covermode=atomic -coverpkg=./... ./... 2>&1 | tee /tmp/gotest.log | gotestfmt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ 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: Create empty database file
run: |
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.7.0] - 2024-08-29

### Changed in 0.7.0

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

## [0.6.2] - 2024-08-05

### Changed in 0.6.2
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ ARG IMAGE_FINAL=senzing/senzingapi-runtime-staging:latest
# Stage: senzingapi_runtime
# -----------------------------------------------------------------------------

FROM ${IMAGE_FINAL} as senzingapi_runtime
FROM ${IMAGE_FINAL} AS senzingapi_runtime

# -----------------------------------------------------------------------------
# Stage: builder
# -----------------------------------------------------------------------------

FROM ${IMAGE_BUILDER} as builder
FROM ${IMAGE_BUILDER} AS builder
ENV REFRESHED_AT=2024-07-01
LABEL Name="senzing/go-builder" \
Maintainer="[email protected]" \
Expand All @@ -32,12 +32,12 @@ COPY . ${GOPATH}/src/init-database

# 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 All @@ -53,7 +53,7 @@ RUN mkdir -p /output \
# Stage: final
# -----------------------------------------------------------------------------

FROM ${IMAGE_FINAL} as final
FROM ${IMAGE_FINAL} AS final
ENV REFRESHED_AT=2024-07-01
LABEL Name="senzing/init-database" \
Maintainer="[email protected]" \
Expand All @@ -77,7 +77,7 @@ USER 1001

# Runtime environment variables.

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

# Runtime execution.

Expand Down
Loading

0 comments on commit df88804

Please sign in to comment.