Skip to content

Commit

Permalink
Merge pull request #4 from senzing-garage/3.dockter.1
Browse files Browse the repository at this point in the history
#3 Working version
  • Loading branch information
docktermj authored Jan 12, 2024
2 parents e0ab5d5 + b11ce66 commit 4a12076
Show file tree
Hide file tree
Showing 14 changed files with 274 additions and 153 deletions.
101 changes: 7 additions & 94 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,100 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.0] - 2024-01-04

### Changed in 0.2.0

- Renamed module to `github.com/senzing-garage/demo-quickstart`
- Refactor to [template-go](https://github.com/senzing-garage/template-go)
- Update dependencies
- github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
- github.com/senzing-garage/go-cmdhelping v0.2.0
- github.com/senzing-garage/go-grpcing v0.2.0
- github.com/senzing-garage/go-observing v0.3.0
- github.com/senzing-garage/go-rest-api-service v0.2.0
- github.com/spf13/cobra v1.8.0
- github.com/spf13/viper v1.18.2
- google.golang.org/grpc v1.60.1

## [0.1.2] - 2023-11-02

### Changed in 0.1.2

- Update dependencies
- github.com/senzing-garage/go-rest-api-service v0.1.1

## [0.1.1] - 2023-10-25

### Changed in 0.1.1

- Refactor to [template-go](https://github.com/senzing-garage/template-go)
- Update dependencies
- github.com/senzing-garage/go-cmdhelping v0.1.9
- github.com/senzing-garage/go-grpcing v0.1.3
- github.com/senzing-garage/go-observing v0.2.8
- github.com/senzing-garage/go-rest-api-service v0.1.0
- github.com/spf13/viper v1.17.0
- google.golang.org/grpc v1.59.0

## [0.1.0] - 2023-10-03

### Changed in 0.1.0

- Supports SenzingAPI 3.8.0
- Deprecated functions have been removed
- Update dependencies
- google.golang.org/grpc v1.58.2

## [0.0.5] - 2023-09-01

### Changed in 0.0.5

- Last version before SenzingAPI 3.8.0

## [0.0.4] - 2023-08-09

### Changed in 0.0.4

- Refactor to `template-go`
- Update dependencies
- github.com/senzing-garage/go-cmdhelping v0.1.5
- github.com/senzing-garage/go-grpcing v0.1.2
- github.com/senzing-garage/go-observing v0.2.7
- github.com/senzing-garage/go-rest-api-service v0.0.5

## [0.0.3] - 2023-07-26

### Changed in 0.0.3

- Update dependencies
- github.com/senzing-garage/go-cmdhelping v0.1.2
- github.com/senzing-garage/go-rest-api-service v0.0.4
- google.golang.org/grpc v1.57.0

## [0.0.2] - 2023-07-21

### Added in 0.0.2

- Opens web browser, unless disabled by `--tty-only`

### Changed in 0.0.2

- Update dependencies
- github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
- github.com/senzing-garage/go-cmdhelping v0.1.1
- github.com/senzing-garage/go-common v0.2.4
- github.com/senzing-garage/go-rest-api-service v0.0.3
- google.golang.org/grpc v1.56.2

## [0.0.1] - 2023-06-19
## [0.0.1] - 2024-01-12

### Added to 0.0.1

- Swagger UI
- Support for following Senzing HTTP REST URIs:
- GET /heartbeat
- GET /specifications/open-api
- GET /license
- GET /version
- XTerm
- Initial functionality
- gRPC
- Senzing API server
- Entity Search
- Swagger UI
- XTerm
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# -----------------------------------------------------------------------------

ARG IMAGE_GO_BUILDER=golang:1.21.4-bullseye
# FIXME: ARG IMAGE_FINAL=senzing/senzingapi-runtime:3.8.0
ARG IMAGE_FINAL=senzing/senzingapi-runtime:3.8.0

# -----------------------------------------------------------------------------
Expand All @@ -20,7 +19,7 @@ FROM ${IMAGE_GO_BUILDER} as go_builder
ENV REFRESHED_AT=2023-10-03
LABEL Name="senzing/demo-quickstart-builder" \
Maintainer="support@senzing.com" \
Version="0.2.0"
Version="0.0.1"

# Copy local files from the Git repository.

Expand Down Expand Up @@ -54,10 +53,11 @@ FROM ${IMAGE_FINAL} as final
ENV REFRESHED_AT=2023-10-03
LABEL Name="senzing/demo-quickstart" \
Maintainer="support@senzing.com" \
Version="0.2.0"
Version="0.0.1"

# Copy files from prior stage.

COPY ./rootfs /
COPY --from=go_builder "/output/linux-amd64/demo-quickstart" "/app/demo-quickstart"

# Runtime environment variables.
Expand Down
146 changes: 145 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,145 @@
# demo-quickstart
# demo-quickstart

If you are beginning your journey with
[Senzing](https://senzing.com/),
please start with
[Senzing Quick Start guides](https://docs.senzing.com/quickstart/).

You are in the
[Senzing Garage](https://github.com/senzing-garage)
where projects are "tinkered" on.
Although this GitHub repository may help you understand an approach to using Senzing,
it's not considered to be "production ready" and is not considered to be part of the Senzing product.
Heck, it may not even be appropriate for your application of Senzing!

## :warning: WARNING: demo-quickstart is still in development :warning: _

At the moment, this is "work-in-progress" with Semantic Versions of `0.n.x`.
Although it can be reviewed and commented on,
the recommendation is not to use it yet.

## Synopsis

`demo-quickstart` is a command in the
[senzing-tools](https://github.com/senzing-garage/senzing-tools)
suite of tools.
This command creates an environment for exploring Senzing.

[![Go Reference](https://pkg.go.dev/badge/github.com/senzing-garage/demo-quickstart.svg)](https://pkg.go.dev/github.com/senzing-garage/demo-quickstart)
[![Go Report Card](https://goreportcard.com/badge/github.com/senzing-garage/demo-quickstart)](https://goreportcard.com/report/github.com/senzing-garage/demo-quickstart)
[![License](https://img.shields.io/badge/License-Apache2-brightgreen.svg)](https://github.com/senzing-garage/demo-quickstart/blob/main/LICENSE)

[![gosec.yaml](https://github.com/senzing-garage/demo-quickstart/actions/workflows/gosec.yaml/badge.svg)](https://github.com/senzing-garage/demo-quickstart/actions/workflows/gosec.yaml)
[![go-test-linux.yaml](https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-linux.yaml/badge.svg)](https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-linux.yaml)
[![go-test-darwin.yaml](https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-darwin.yaml/badge.svg)](https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-darwin.yaml)
[![go-test-windows.yaml](https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-windows.yaml/badge.svg)](https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-windows.yaml)

## Overview

`demo-quickstart` starts the Senzing gRPC server and HTTP server for use in Senzing exploration.

Senzing SDKs for accessing the gRPC server:

1. Go: [g2-sdk-go-grpc](https://github.com/senzing/g2-sdk-go-grpc)
1. Python: [g2-sdk-python-grpc](https://github.com/senzing-garage/g2-sdk-python-grpc)

A simple demonstration using `senzing-tools` and a SQLite database.

```console
export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
export SENZING_TOOLS_DATABASE_URL=sqlite3://na:na@/tmp/sqlite/G2C.db
senzing-tools init-database
senzing-tools demo-quickstart

```

Then visit [localhost:8261](http://localhost:8261)

## Install

1. The `demo-quickstart` command is installed with the
[senzing-tools](https://github.com/senzing-garage/senzing-tools)
suite of tools.
See senzing-tools [install](https://github.com/senzing-garage/senzing-tools#install).

## Use

```console
export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
senzing-tools demo-quickstart [flags]
```

1. For options and flags:
1. [Online documentation](https://hub.senzing.com/senzing-tools/senzing-tools_demo-quickstart.html)
1. Runtime documentation:

```console
export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
senzing-tools demo-quickstart --help
```

1. In addition to the following simple usage examples, there are additional [Examples](docs/examples.md).

### Using command line options

1. :pencil2: Specify database using command line option.
Example:

```console
export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
senzing-tools demo-quickstart \
--database-url postgresql://username:password@postgres.example.com:5432/G2 \

```

1. Visit [localhost:8261](http://localhost:8261)
1. Run `senzing-tools demo-quickstart --help` or see [Parameters](#parameters) for additional parameters.

### Using environment variables

1. :pencil2: Specify database using environment variable.
Example:

```console
export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
export SENZING_TOOLS_DATABASE_URL=postgresql://username:password@postgres.example.com:5432/G2
senzing-tools demo-quickstart
```

1. Visit [localhost:8261](http://localhost:8261)
1. Run `senzing-tools demo-quickstart --help` or see [Parameters](#parameters) for additional parameters.

### Using Docker

This usage shows how to initialze a database with a Docker container.

1. This usage specifies a URL of an external database.
Example:

```console
docker run \
--publish 8260:8260 \
--publish 8261:8261 \
--rm \
senzing/senzing-tools demo-quickstart

```

1. Visit [localhost:8261](http://localhost:8261)
1. See [Parameters](#parameters) for additional parameters.

### Parameters

- **[SENZING_TOOLS_DATABASE_URL](https://github.com/senzing-garage/knowledge-base/blob/main/lists/environment-variables.md#senzing_tools_database_url)**
- **[SENZING_TOOLS_ENGINE_CONFIGURATION_JSON](https://github.com/senzing-garage/knowledge-base/blob/main/lists/environment-variables.md#senzing_tools_engine_configuration_json)**
- **[SENZING_TOOLS_ENGINE_LOG_LEVEL](https://github.com/senzing-garage/knowledge-base/blob/main/lists/environment-variables.md#senzing_tools_engine_log_level)**
- **[SENZING_TOOLS_ENGINE_MODULE_NAME](https://github.com/senzing-garage/knowledge-base/blob/main/lists/environment-variables.md#senzing_tools_engine_module_name)**
- **[SENZING_TOOLS_GRPC_PORT](https://github.com/senzing-garage/knowledge-base/blob/main/lists/environment-variables.md#senzing_tools_grpc_port)**
- **[SENZING_TOOLS_LOG_LEVEL](https://github.com/senzing-garage/knowledge-base/blob/main/lists/environment-variables.md#senzing_tools_log_level)**

## References

1. [Command reference](https://hub.senzing.com/senzing-tools/senzing-tools_demo-quickstart.html)
1. [Development](docs/development.md)
1. [Errors](docs/errors.md)
1. [Examples](docs/examples.md)
2 changes: 2 additions & 0 deletions cmd/context_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ var ContextVariablesForOsArch = []option.ContextVariable{
option.ResourcePath,
option.SupportPath,
}

const SENZING_TOOLS_DATABASE_URL = "sqlite3://na:na@/tmp/sqlite/G2C.db"
2 changes: 2 additions & 0 deletions cmd/context_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ package cmd
import "github.com/senzing-garage/go-cmdhelping/option"

var ContextVariablesForOsArch = []option.ContextVariable{}

const SENZING_TOOLS_DATABASE_URL = "sqlite3://na:na@/tmp/sqlite/G2C.db"
2 changes: 2 additions & 0 deletions cmd/context_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ package cmd
import "github.com/senzing-garage/go-cmdhelping/option"

var ContextVariablesForOsArch = []option.ContextVariable{}

const SENZING_TOOLS_DATABASE_URL = ""
Loading

0 comments on commit 4a12076

Please sign in to comment.