Skip to content

Commit

Permalink
Dev 4.0 (#21)
Browse files Browse the repository at this point in the history
* refactory for 4.0.0

* updated
  • Loading branch information
ecow authored Dec 31, 2023
1 parent 8e37d14 commit 53fe9c6
Show file tree
Hide file tree
Showing 89 changed files with 1,323 additions and 2,477 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [unreleased]

### Fixed
Complete project refactory


- reopened bug #19 (FAILCHECK mode does not work): removed extra blank

## [3.3.1]

Expand Down
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# How to Contribute

We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to
[LinkedData.Center's Contributor License Agreement (CLA)](http://sites.linkeddata.center/help/legal/cla_v1).

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

60 changes: 21 additions & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,54 +1,36 @@
# Copyright (C) 2019-2020 LinkedData.Center - All Rights Reserved
# Permission to copy and modify is granted under the MIT license
FROM alpine/helm as helm
FROM mikefarah/yq as yq
FROM linkeddatacenter/sdaas-rdfstore:2.1.5
# Copyright (C) 2023 LinkedData.Center - All Rights Reserved
FROM ubuntu:22.04

LABEL authors="[email protected]"

USER root
COPY --from=helm /usr/bin/helm /usr/bin/helm
COPY --from=yq /usr/bin/yq /usr/bin/yq

ARG SHACLVER=1.3.2
ARG SHACLROOT=/opt/shacl-${SHACLVER}/bin

RUN apt-get update && \
apt-get install -y --no-install-recommends \
gettext \
curl \
ca-certificates \
raptor2-utils \
bats \
git \
unzip \
jq \
csvtool && \
curl --output /tmp/shacl.zip https://repo1.maven.org/maven2/org/topbraid/shacl/${SHACLVER}/shacl-${SHACLVER}-bin.zip && \
unzip /tmp/shacl.zip -d /opt && \
chmod +x ${SHACLROOT}/*


csvtool \
libxml2-utils

###### Variables affecting the image building
ENV SDAAS_BIN_DIR=/opt/sdaas
ENV SDAAS_INSTALL_DIR=/opt/sdaas
ENV SDAAS_WORKSPACE=/workspace
ENV SDAAS_LOG_DIR="$SDAAS_WORKSPACE"
ENV PATH=${SHACLROOT}:${PATH}

COPY modules "$SDAAS_INSTALL_DIR"
COPY bin/sdaas /usr/bin/sdaas
COPY /etc/* /etc/
RUN chmod -R 0755 /usr/bin/sdaas

###### Runtime variables
ENV SD_UPLOAD_DIR /var/spool/sdaas
ENV SD_SPARQL_ENDPOINT http://localhost:8080/sdaas/sparql
ENV SD_QUADSTORE kb

COPY scripts "$SDAAS_BIN_DIR"
COPY sdaas-entrypoint.sh /sdaas-entrypoint.sh

RUN mkdir -p "${SDAAS_BIN_DIR}" "${SDAAS_LOG_DIR}" "${SD_UPLOAD_DIR}" "${SDAAS_WORKSPACE}" ; \
chmod -R 0755 "$SDAAS_BIN_DIR" /sdaas-entrypoint.sh; \
chown -R jetty.jetty "${SDAAS_WORKSPACE}" "$SDAAS_LOG_DIR" "$SD_UPLOAD_DIR"
RUN useradd -m -d /workspace -s /bin/bash -g users -u 1001 sdaas
USER sdaas
WORKDIR "${SDAAS_WORKSPACE}"

## Variables affecting program execution
ENV SD_LOG_PRIORITY=6
ENV SD_TMP_DIR="/tmp"

USER jetty
# Uncomment this to change the default web agent signature
#ENV SD_APPLICATION_ID="example.org SDaaS"

WORKDIR "${SDAAS_WORKSPACE}"
ENTRYPOINT ["/sdaas-entrypoint.sh"]
CMD [""]
ENTRYPOINT ["/usr/bin/sdaas"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2019 LinkedData.Center SRL
Copyright (c) 2018-2024 LinkedData.Center SRL

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
107 changes: 38 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,117 +4,86 @@

A platform to build knowledge graphs.

This is an open source implementation of the [LinkeData.Center SDaaS™ product](https://it.linkeddata.center/p/sdaas).
See documentation in [SDaaS wiki](https://bitbucket.org/linkeddatacenter/sdaas/wiki/Home).
This is the open source implementation of the [LinkeData.Center SDaaS™ product](https://it.linkeddata.center/p/sdaas).

The SDaaS requires [docker](https://www.docker.com/)

This implementation embeds a sdaas-rdfstore based on blazegraph.



> ## End of Support approaching
> ## end-of-support approaching for Anassimene releases (SDaaS 3.x)
>
> Starting from the major release of version 4 of SDaaS Enterprise Edition, planned for 2024 Q1,
> Starting from the major release of version 4 of SDaaS (Pitagora), planned in 2024 Q1,
> The Community Edition 3.x will no longer supported by LinkedData.Center.
>
> If you plan to use SDaaS for professional use, please consider moving to Enterprise Edition.
> Contact https://LinkedData.Center for more info, prices, support and documentation.
>
> This repository will continue to exists and maintained and support from community is welcome
>
> As always, documentation, support, and training for SDaaS Community Edition will continue to be available by LinkedData.Center as professional services.
## 🚀 Quickstart

This command will start a sdaas platform attached to an internal rdfstore with a micro memory foorprint
docker run --rm -ti -p 8080:8080 linkeddatacenter/sdaas-ce --reboot

browse local reasoner at http://localhost:8080/sdaas type `exit` to leave the platform.

This command is the same as the previous but does not expose the workbench and uses a small memory foorprint

docker run --rm -ti -e SDAAS_SIZE=small linkeddatacenter/sdaas-ce
### 🚀 Quickstart

```
docker compose up -d --build
docker compose logs tests
docker compose exec cli sdaas
exit
docker compose down
```

To run sdaas platform withouth the local rdfstore

docker run --rm -ti -e SD_NOWARMUP=1 linkeddatacenter/sdaas-ce

Use this command to start and stop by hand a local micro rdfstore:
## Installation & usage

SD_START_LOCAL_REASONING_ENGINE # you can specify the required memory footprint, default=micro
SD_STOP_LOCAL_REASONING_ENGINE
See the [documentation](https://gitlab.com/linkeddatacenter/sdaas/doc) for more info.


## Start test environment

** build local image:**


docker build -t sdaas .
**setup a vpn and run a graph store:**

To run functional and system tests you will need the local instance of blazegraph running in the same network of SDaaS.
By default, test scripts expect blazegraph endpoint at http://kb:8080/sdaas.

**Smoke tests:**
```
docker network create myvpn
docker run --network myvpn --name kb -d linkeddatacenter/sdaas-rdfstore
```

Manually start sdaas cli without the local reasoner
**build and run local image:**

```
docker run --name sdmp --rm -ti -v ${PWD}:/workspace --entrypoint bash sdaas
git --version
jq --version
yq --version
gettext --version
command -v csvtool
command -v shaclvalidate.sh
scripts/sdaas
exit
docker build -t linkeddatacenter/sdaas-ce .
docker run --rm -ti --network=myvpn -v "${PWD}":/workspace linkeddatacenter/sdaas-ce
```


**Unit tests:**

In order to run unit tests bats is needed (see https://github.com/bats-core/bats-core ):
In order to run unit tests bats is used (see https://github.com/bats-core/bats-core ):

bats tests/unit/

```
bats tests/unit/
```

**Functional tests:**

To run functional and system tests you will need the local instance of blazegraph.
By default, test scripts expect blazegraph endpoint at http://localhost:8080/sdaas
but you can configure a different address exporting the the SD_SPARQL_ENDPOINT.
The instance of blazegraph must share /workspace volume with sdaas.


For functional test execute:
For functional tests, execute:

```
/sdaas-start -d #start embedded graph engine in background
bats tests/functional
```

**System tests:**

For system test, verify that the host is able to access Internet then execute
For system tests, verify that the host can access the Internet then execute:

```
bats tests/system/platform
scripts/sdaas
SD_SPARQL_QUERY csv "SELECT (COUNT(?s) AS ?edges) WHERE{?s?p?o}"
curl -d ESTCARD http://localhost:8080/sdaas/sparql
# in both case you should > 31K triples
SD_SPARQL_UPDATE "DROP ALL"
exit
bats tests/system
```

To free the docker resources:

exit

```
exit
docker rm -f kb
docker network rm myvpn
```

Have a look also to the [developer wiki](https://github.com/linkeddatacenter/sdaas-ce/wiki)


## Push to docker hub
Expand All @@ -125,17 +94,17 @@ To push a new docker image to docker hub:
docker login
# input the docker hub credentials...
docker build -t linkeddatacenter/sdaas-ce .
docker tag linkeddatacenter/sdaas-ce linkeddatacenter/sdaas-ce:3.3.1
docker push linkeddatacenter/sdaas-ce
docker push linkeddatacenter/sdaas-ce:3.3.1
docker tag linkeddatacenter/sdaas-ce linkeddatacenter/sdaas-ce:4.0.0-rc1
docker push linkeddatacenter/sdaas-ce:4.0.0-rc1
```


## Credits and license

The sdaas community edition platform is derived from [LinkedData.Center SDaas Product](https://it.linkeddata.center/p/sdaas) and licensed with MIT by LinkedData.Center

Copyright (C) 2018-2023 LinkedData.Center SRL
Copyright (C) 2018-2024 LinkedData.Center SRL
- All Rights Reserved
Permission to copy and modify is granted under the [MIT license](LICENSE)

4 changes: 4 additions & 0 deletions bin/sdaas
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Copyright (C) 2023 LinkedData.Center - All Rights Reserved

exec bash --init-file $SDAAS_INSTALL_DIR/core "$@"
25 changes: 25 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: "3.3"

services:

kb:
image: linkeddatacenter/sdaas-rdfstore
ports:
- "9999:8080"

cli:
build: .
stdin_open: true
tty: true
depends_on:
- kb
volumes:
- .:/workspace

tests:
build: .
command: sdaas -c "bats tests/{unit,functional,system}"
depends_on:
- kb
volumes:
- .:/workspace
8 changes: 8 additions & 0 deletions etc/splash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
____ ____ ____
/ ___|| _ \ __ _ __ _/ ___|
\___ \| | | |/ _` |/ _` \___ \
___) | |_| | (_| | (_| |___) |
|____/|____/ \__,_|\__,_|____/

Smart Data as a Service platform - Pitagora edition

Loading

0 comments on commit 53fe9c6

Please sign in to comment.