Skip to content

Commit

Permalink
#134 New UI (#142)
Browse files Browse the repository at this point in the history
* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 non-working Jupyter Lab

* #134 Savepoint

* #134 Savepoint

* #134 Change from demo-quickstart to playground

* #134 Change from demo-quickstart to playground

* #134 Change from demo-quickstart to playground

* #134 Add accordions

* #134 Rearranage directories

* #134 Rearranage directories

* #134 Rearranage directories

* #134 Rearranage directories

* #134 Savepoint

* #134 Add icons

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Savepoint

* #134 Update dependencies

* #134 Use FACTORY_PARAMETERS

* #134 Improve icons in more information on topics

* #134 Loosen permissions on /app

* #134 Prepare for versioned release

* #134 Prepare for versioned release

* #134 Fix workflow issues

* #134 Fix workflow issues
  • Loading branch information
docktermj authored Nov 19, 2024
1 parent ce3e621 commit b4efd40
Show file tree
Hide file tree
Showing 83 changed files with 3,313 additions and 992 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bandit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: "examples src"
path: "rootfs/examples"
recursive: "true"
2 changes: 1 addition & 1 deletion .github/workflows/flake8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ jobs:
uses: py-actions/flake8@v2
with:
max-line-length: 88
path: src
path: rootfs/examples
plugins: flake8-black
2 changes: 1 addition & 1 deletion .github/workflows/go-test-darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: mkdir -p /tmp/sqlite && cp testdata/sqlite/G2C.db /tmp/sqlite/

- name: Run go test
run: go test -exec /Users/runner/work/demo-quickstart/demo-quickstart/bin/macos_exec_dyld.sh -json -v -p 1 -coverprofile=./cover.out -covermode=atomic -coverpkg=./... ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
run: go test -exec /Users/runner/work/playground/playground/bin/macos_exec_dyld.sh -json -v -p 1 -coverprofile=./cover.out -covermode=atomic -coverpkg=./... ./... 2>&1 | tee /tmp/gotest.log | gotestfmt

- name: Store coverage file
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/isort.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
uses: isort/isort-action@v1
with:
requirements-files: requirements.txt
sort-paths: "src/senzing_quickstart"
sort-paths: "rootfs/examples"
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[settings]
profile=black
src_paths=src
src_paths=rootfs/examples
2 changes: 1 addition & 1 deletion .project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>demo-quickstart</name>
<name>playground</name>
<comment></comment>
<projects>
</projects>
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning].

## [Unreleased]

## [0.4.0] - 2024-11-19

### Changed in 0.4.0

- Migrate from `demo-quickstart` to `playground`

## [0.3.2] - 2024-11-14

### Changed in 0.3.2

- Support SQLite in-memory database

## [0.3.1] - 2024-10-30

### Changed in 0.3.1
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The variables are used throughout the installation procedure.

```console
export GIT_ACCOUNT=senzing-garage
export GIT_REPOSITORY=demo-quickstart
export GIT_REPOSITORY=playground
```

Synthesize environment variables.
Expand Down
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ USER root

RUN apt-get update \
&& apt-get -y install \
libsqlite3-dev \
python3 \
python3-dev \
python3-pip \
Expand All @@ -51,7 +52,7 @@ RUN pip3 install --upgrade pip \
# Copy local files from the Git repository.

COPY ./rootfs /
COPY . ${GOPATH}/src/demo-quickstart
COPY . ${GOPATH}/src/playground

# Copy files from prior stage.

Expand All @@ -64,24 +65,23 @@ ENV LD_LIBRARY_PATH=/opt/senzing/er/lib/

# Build go program.

WORKDIR ${GOPATH}/src/demo-quickstart
RUN make print-make-variables
RUN make --debug=vijm build
WORKDIR ${GOPATH}/src/playground
RUN make build-with-libsqlite3

# Copy binaries to /output.

RUN mkdir -p /output \
&& cp -R ${GOPATH}/src/demo-quickstart/target/* /output/
&& cp -R ${GOPATH}/src/playground/target/* /output/

# -----------------------------------------------------------------------------
# Stage: final
# -----------------------------------------------------------------------------

FROM ${IMAGE_FINAL} AS final
ENV REFRESHED_AT=2024-07-01
LABEL Name="senzing/demo-quickstart" \
LABEL Name="senzing/playground" \
Maintainer="support@senzing.com" \
Version="0.0.1"
Version="0.3.2"


ARG BUILD_USER="senzing"
Expand All @@ -100,6 +100,7 @@ RUN export STAT_TMP=$(stat --format=%a /tmp) \
gnupg2 \
jq \
libodbc1 \
libsqlite3-dev \
postgresql-client \
supervisor \
unixodbc \
Expand Down Expand Up @@ -129,12 +130,12 @@ COPY ./rootfs /

# Copy files from prior stage.

COPY --from=builder /output/linux/demo-quickstart /app/demo-quickstart
COPY --from=builder /output/linux/playground /app/playground
COPY --from=builder /app/venv /app/venv

# Prepare jupyter lab environment.

RUN chmod --recursive 777 /tmp /notebooks
RUN chmod --recursive 777 /app /examples /tmp

# Create ${BUILD_USER} user.

Expand All @@ -147,7 +148,7 @@ USER ${BUILD_USER}
# Activate virtual environment.

ENV VIRTUAL_ENV=/app/venv
ENV PATH="/app/venv/bin:${PATH}"
ENV PATH="/app/venv/bin:/examples/python:${PATH}"

# Runtime environment variables.

Expand All @@ -159,7 +160,9 @@ ENV SENZING_API_SERVER_PORT='8250'
ENV SENZING_API_SERVER_SKIP_ENGINE_PRIMING='true'
ENV SENZING_API_SERVER_SKIP_STARTUP_PERF='true'
ENV SENZING_DATA_MART_SQLITE_DATABASE_FILE=/tmp/datamart
ENV SENZING_ENGINE_CONFIGURATION_JSON='{"PIPELINE": {"CONFIGPATH": "/etc/opt/senzing", "LICENSESTRINGBASE64": "", "RESOURCEPATH": "/opt/senzing/er/resources", "SUPPORTPATH": "/opt/senzing/data"}, "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"}}'
ENV SENZING_ENGINE_CONFIGURATION_JSON='{"PIPELINE": {"CONFIGPATH": "/etc/opt/senzing", "LICENSESTRINGBASE64": "", "RESOURCEPATH": "/opt/senzing/er/resources", "SUPPORTPATH": "/opt/senzing/data"}, "SQL": {"CONNECTION": "sqlite3://na:na@nowhere/IN_MEMORY_DB?mode=memory&cache=shared"}}'
# ENV SENZING_ENGINE_CONFIGURATION_JSON='{"PIPELINE": {"CONFIGPATH": "/etc/opt/senzing", "LICENSESTRINGBASE64": "", "RESOURCEPATH": "/opt/senzing/er/resources", "SUPPORTPATH": "/opt/senzing/data"}, "SQL": {"CONNECTION": "sqlite3://na:na@nowhere/tmp/sqlite/G2C.db"}}'
ENV SENZING_TOOLS_ENABLE_ALL=true

# Runtime execution.

Expand Down
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,24 @@ lint: golangci-lint pylint mypy bandit black flake8 isort

PLATFORMS := darwin/amd64 darwin/arm64 linux/amd64 linux/arm64 windows/amd64 windows/arm64
$(PLATFORMS):
$(info Building $(TARGET_DIRECTORY)/$(GO_OS)-$(GO_ARCH)/$(PROGRAM_NAME) for $(PLATFORMS))
$(info Building $(TARGET_DIRECTORY)/$(GO_OS)-$(GO_ARCH)/$(PROGRAM_NAME))
@GOOS=$(GO_OS) GOARCH=$(GO_ARCH) go build -o $(TARGET_DIRECTORY)/$(GO_OS)-$(GO_ARCH)/$(PROGRAM_NAME)


PLATFORMS_WITH_LIBSQLITE3 := linux/amd64/libsqlite3 linux/arm64/libsqlite3
$(PLATFORMS_WITH_LIBSQLITE3):
$(info Building $(TARGET_DIRECTORY)/$(GO_OS)-$(GO_ARCH)/$(PROGRAM_NAME))
@GOOS=$(GO_OS) GOARCH=$(GO_ARCH) go build -tags "libsqlite3 linux" -o $(TARGET_DIRECTORY)/$(GO_OS)-$(GO_ARCH)/$(PROGRAM_NAME)


.PHONY: build
build: build-osarch-specific


.PHONY: build-with-libsqlite3
build-with-libsqlite3: build-with-libsqlite3-osarch-specific


.PHONY: docker-build
docker-build: docker-build-osarch-specific

Expand Down
146 changes: 28 additions & 118 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# demo-quickstart
# playground

If you are beginning your journey with [Senzing],
please start with [Senzing Quick Start guides].
Expand All @@ -8,16 +8,15 @@ Although this GitHub repository may help you understand an approach to using Sen
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: _
## :warning: WARNING: playground 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] suite of tools.
This command creates an environment for exploring Senzing.
`playground` creates an environment for exploring Senzing.

[![Go Reference Badge]][Package reference]
[![Go Report Card Badge]][Go Report Card]
Expand All @@ -30,104 +29,25 @@ This command creates an environment for exploring Senzing.

## 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: [sz-sdk-go-grpc]
1. Python: [sz-sdk-python-grpc]

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

```console
export LD_LIBRARY_PATH=/opt/senzing/er/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]
`playground` starts the Senzing gRPC server and HTTP server for use in Senzing exploration.
A user visits the web interface to help with the exploration.

## Install

1. The `demo-quickstart` command is installed with the [senzing-tools] suite of tools.
See [senzing-tools install].

## Use
To start the Senzing Playground, run

```console
export LD_LIBRARY_PATH=/opt/senzing/er/lib/
senzing-tools demo-quickstart [flags]
docker run -it --name senzing-playground -p 8260:8260 -p 8261:8261 --rm senzing/playground
```

1. For options and flags:
1. [Online documentation]
1. Runtime documentation:

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

1. In addition to the following simple usage examples, there are additional [Examples].

### Using command line options

1. :pencil2: Specify database using command line option.
Example:
then visit [localhost:8260].

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

```

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

### Using environment variables

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

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

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

### Using Docker

This usage shows how to initialize 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]
1. See [Parameters] for additional parameters.
## Use

### Parameters
Senzing SDKs for accessing the gRPC server:

- **[SENZING_TOOLS_DATABASE_URL]**
- **[SENZING_TOOLS_ENGINE_CONFIGURATION_JSON]**
- **[SENZING_TOOLS_ENGINE_LOG_LEVEL]**
- **[SENZING_TOOLS_ENGINE_MODULE_NAME]**
- **[SENZING_TOOLS_GRPC_PORT]**
- **[SENZING_TOOLS_LOG_LEVEL]**
1. Go: [sz-sdk-go-grpc]
1. Python: [sz-sdk-python-grpc]

## References

Expand All @@ -137,38 +57,28 @@ This usage shows how to initialize a database with a Docker container.
1. [Examples]
1. [DockerHub]

[Command reference]: https://garage.senzing.com/senzing-tools/senzing-tools_demo-quickstart.html
[Command reference]: https://garage.senzing.com/senzing-tools/senzing-tools_playground.html
[Development]: docs/development.md
[DockerHub]: https://hub.docker.com/r/senzing/demo-quickstart
[DockerHub]: https://hub.docker.com/r/senzing/playground
[Errors]: docs/errors.md
[Examples]: docs/examples.md
[Go Reference Badge]: https://pkg.go.dev/badge/github.com/senzing-garage/demo-quickstart.svg
[Go Report Card Badge]: https://goreportcard.com/badge/github.com/senzing-garage/demo-quickstart
[Go Report Card]: https://goreportcard.com/report/github.com/senzing-garage/demo-quickstart
[go-test-darwin.yaml Badge]: https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-darwin.yaml/badge.svg
[go-test-darwin.yaml]: https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-darwin.yaml
[go-test-linux.yaml Badge]: https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-linux.yaml/badge.svg
[go-test-linux.yaml]: https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-linux.yaml
[go-test-windows.yaml Badge]: https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-windows.yaml/badge.svg
[go-test-windows.yaml]: https://github.com/senzing-garage/demo-quickstart/actions/workflows/go-test-windows.yaml
[golangci-lint.yaml Badge]: https://github.com/senzing-garage/demo-quickstart/actions/workflows/golangci-lint.yaml/badge.svg
[golangci-lint.yaml]: https://github.com/senzing-garage/demo-quickstart/actions/workflows/golangci-lint.yaml
[Go Reference Badge]: https://pkg.go.dev/badge/github.com/senzing-garage/playground.svg
[Go Report Card Badge]: https://goreportcard.com/badge/github.com/senzing-garage/playground
[Go Report Card]: https://goreportcard.com/report/github.com/senzing-garage/playground
[go-test-darwin.yaml Badge]: https://github.com/senzing-garage/playground/actions/workflows/go-test-darwin.yaml/badge.svg
[go-test-darwin.yaml]: https://github.com/senzing-garage/playground/actions/workflows/go-test-darwin.yaml
[go-test-linux.yaml Badge]: https://github.com/senzing-garage/playground/actions/workflows/go-test-linux.yaml/badge.svg
[go-test-linux.yaml]: https://github.com/senzing-garage/playground/actions/workflows/go-test-linux.yaml
[go-test-windows.yaml Badge]: https://github.com/senzing-garage/playground/actions/workflows/go-test-windows.yaml/badge.svg
[go-test-windows.yaml]: https://github.com/senzing-garage/playground/actions/workflows/go-test-windows.yaml
[golangci-lint.yaml Badge]: https://github.com/senzing-garage/playground/actions/workflows/golangci-lint.yaml/badge.svg
[golangci-lint.yaml]: https://github.com/senzing-garage/playground/actions/workflows/golangci-lint.yaml
[License Badge]: https://img.shields.io/badge/License-Apache2-brightgreen.svg
[License]: https://github.com/senzing-garage/demo-quickstart/blob/main/LICENSE
[localhost:8261]: http://localhost:8261
[Online documentation]: https://hub.senzing.com/senzing-tools/senzing-tools_demo-quickstart.html
[Package reference]: https://pkg.go.dev/github.com/senzing-garage/demo-quickstart
[Parameters]: #parameters
[License]: https://github.com/senzing-garage/playground/blob/main/LICENSE
[localhost:8260]: http://localhost:8260
[Package reference]: https://pkg.go.dev/github.com/senzing-garage/playground
[Senzing Garage]: https://github.com/senzing-garage-garage
[Senzing Quick Start guides]: https://docs.senzing.com/quickstart/
[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
[senzing-tools install]: https://github.com/senzing-garage/senzing-tools#install
[senzing-tools]: https://github.com/senzing-garage/senzing-tools
[Senzing]: https://senzing.com/
[sz-sdk-go-grpc]: https://github.com/senzing-garage/sz-sdk-go-grpc
[sz-sdk-python-grpc]: https://github.com/senzing-garage/sz-sdk-python-grpc
4 changes: 2 additions & 2 deletions cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ var completionCmd = &cobra.Command{
Use: "completion",
Short: "Generate bash completion for the command",
Long: `To load completions, run:
source < (demo-quickstart completion)
source < (playground completion)
To load completions automaticallon on login, add this line to your .bashrc file:
source < (demo-quickstart completion)
source < (playground completion)
`,
RunE: func(cmd *cobra.Command, args []string) error {
_ = cmd
Expand Down
Loading

0 comments on commit b4efd40

Please sign in to comment.