Skip to content

Commit

Permalink
Merge pull request #17 from aerospike/maintenance
Browse files Browse the repository at this point in the history
v1.2.0
  • Loading branch information
reugn authored Apr 2, 2020
2 parents e2a9df9 + 04ec2d8 commit 1b5ac69
Show file tree
Hide file tree
Showing 34 changed files with 6,177 additions and 4,856 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.cache
.travis
build

.idea
.vscode

*.md
!README*.md
README-secret.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ gradlew.bat
.classpath
/.gradle/
.vscode/
.idea/
54 changes: 27 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
language: java
sudo: false

os:
- linux
dist: trusty
- linux
dist: xenial

install:
- wget -O aerospike-server.tgz http://aerospike.com/download/server/latest/artifact/tgz
- tar xvzf aerospike-server.tgz
- cp -f .travis/aerospike.conf ./aerospike-server/share/etc
- cd aerospike-server
- sed -i -e 's/\${me}/"root"/' share/libexec/aerospike-start
- sed -i -e 's/set_shmall$/#set_shmall/' share/libexec/aerospike-start
- sed -i -e 's/set_shmmax$/#set_shmmax/' share/libexec/aerospike-start
- mkdir instance1
- mkdir instance2
- ./bin/aerospike init --home instance1 --instance 1 --service-port 3000
- ./bin/aerospike init --home instance2 --instance 2 --service-port 3010
- cd instance1
- ./bin/aerospike start
- ../../.travis/wait-for-node.sh var/log/aerospike.log
- cd ..
- cd instance2
- ./bin/aerospike start
- ../../.travis/wait-for-node.sh var/log/aerospike.log
- cd ../..
- wget -O aerospike-server.tgz http://aerospike.com/download/server/latest/artifact/tgz
- tar xvzf aerospike-server.tgz
- cp -f .travis/aerospike.conf ./aerospike-server/share/etc
- cd aerospike-server
- sed -i -e 's/\${me}/"root"/' share/libexec/aerospike-start
- sed -i -e 's/set_shmall$/#set_shmall/' share/libexec/aerospike-start
- sed -i -e 's/set_shmmax$/#set_shmmax/' share/libexec/aerospike-start
- mkdir instance1
- mkdir instance2
- ./bin/aerospike init --home instance1 --instance 1 --service-port 3000
- ./bin/aerospike init --home instance2 --instance 2 --service-port 3010
- cd instance1
- sudo ./bin/aerospike start
- ../../.travis/wait-for-node.sh var/log/aerospike.log
- cd ..
- cd instance2
- sudo ./bin/aerospike start
- ../../.travis/wait-for-node.sh var/log/aerospike.log
- cd ../..
script:
- export aerospike_restclient_hostname=localhost
- export aerospike_restclient_port=3000
- ./gradlew test
- export aerospike_restclient_hostname=localhost
- export aerospike_restclient_port=3000
- ./gradlew test
notifications:
slack:
secure: QaCE4lTfpv57X921q5oCrHrB1qqkLsnGM2+L/zCTEQKc20tNnfNjrDsFJGrLibZbEvZCcVOfr1xH0WhaPurngG6uTRLUqWBf3evwnMgTWDxFU0wcZlKR/Vww3zNXBuD4tDafC1bEa/fm+9xDDmtlV8AaySpiwQazLtwqOatoTD8=
hipchat:
rooms:
secure: LmFIM1e/9Vr4Fx7abosnnc5gsgnSTCiOBSJlA62CeHa7xnOcz7k6LCw7VVtwZIaxnszDxMRx5Jn0d8P7JhX6XRu1BveWB9Ybpuan9i3+F+lHBusKMw5vFShquran//K1O3Or81rBxXc27Rd9K05rnH0747mlr2fNSfDJv2wygdI=
email:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
3 changes: 1 addition & 2 deletions .travis/aerospike.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ service {
run-as-daemon
paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
pidfile ${home}/var/run/aerospike.pid
transaction-queues 8
transaction-threads-per-queue 8
proto-fd-max 15000
work-directory ${home}/var
}

Expand Down
7 changes: 0 additions & 7 deletions BUILD.md

This file was deleted.

15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM openjdk:8-jdk-alpine AS build
WORKDIR /workspace/app

COPY . /workspace/app
RUN ./gradlew clean build -x test
RUN mkdir -p build/dependency && (cd build/dependency; jar -xf ../libs/*.jar)

FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG DEPENDENCY=/workspace/app/build/dependency
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
EXPOSE 8080
ENTRYPOINT ["java","-cp","app:app/lib/*","com.aerospike.restclient.AerospikeRestClientApplication"]
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ ARCHIVEDIR=aerospike-client-rest-$(VERSION)
ARCHIVENAME=$(ARCHIVEDIR).tgz

.PHONY: package
package: clean war validatedocs
package: clean build validatedocs
mkdir $(ARCHIVEDIR)
mkdir target
cp build/libs/*.war $(ARCHIVEDIR)
cp build/libs/*.jar $(ARCHIVEDIR)
cp docs/swagger.json $(ARCHIVEDIR)
tar -czvf target/$(ARCHIVENAME) $(ARCHIVEDIR)

.PHONY: war
war:
./gradlew bootWar
.PHONY: build
build:
./gradlew build

.PHONY: clean
clean:
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
# aerospike-client-rest

[![Build Status](https://travis-ci.org/aerospike/aerospike-client-rest.svg?branch=master)](https://travis-ci.org/aerospike/aerospike-client-rest)

The Aerospike REST client provides a server which translates Restful API requests into messages to an Aerospike Cluster.

It can be used as a bridge between applications written in languages without an existing Aerospike Client library, or as a pluggable component in a pre-existing architecture.

## Installation

For instructions on installing the REST Client from a `.war` file see [Installation and Configuration](./docs/installation-and-config.md) .
For instructions on installing the Rest Client see [Installation and Configuration](./docs/installation-and-config.md) .

## Building
## Build

To build a `.war` file for the REST client, run
* Executable Jar

```sh
./gradlew bootWar
./gradlew build
```

This will place the file in the `build/libs` directory.

## Running Locally
* Docker Image

```sh
docker build -t aerospike-client-rest .
```

## Run Locally

To run the REST Client locally during development:

Expand All @@ -41,3 +49,6 @@ After installing and starting the REST client, you can try out the API using an
The Swagger `.JSON` specification of the API is available at: `http://<API_ENDPOINT>:8080/v2/api-docs` .

So if the REST Client is running on localhost these URLs would be `http://localhost:8080/swagger-ui.html` and `http://localhost:8080/v2/api-docs`.

## License
Licensed under the [Apache 2.0 License](./LICENSE).
16 changes: 7 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
buildscript {
ext {
springBootVersion = '2.1.1.RELEASE'
springBootVersion = '2.2.6.RELEASE'
springfoxVersion = '2.9.2'
httpclientVersion = '4.5.8'
aerospikeClientVersion = findProperty('aerospikeClientVersion') ?:'4.4.2'
httpclientVersion = '4.5.12'
aerospikeClientVersion = findProperty('aerospikeClientVersion') ?:'4.4.9'
}
if (findProperty("aerospikeUseLocal")) {
print("using Local repo")
Expand Down Expand Up @@ -31,15 +31,15 @@ repositories{

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'war'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.aerospike'
sourceCompatibility = 1.8

bootWar {
archiveName "${warBaseName}##${appVersion}.war"
bootJar {
baseName "${jarBaseName}"
version "${appVersion}"
}
test {
testLogging {
Expand All @@ -50,14 +50,12 @@ repositories {
mavenCentral()
}


dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile("com.aerospike:aerospike-client:${aerospikeClientVersion}")
compile('org.msgpack:jackson-dataformat-msgpack:0.8.16')
compile('org.msgpack:jackson-dataformat-msgpack:0.8.20')
compile("io.springfox:springfox-swagger2:${springfoxVersion}")
compile("io.springfox:springfox-swagger-ui:${springfoxVersion}")
implementation "org.apache.httpcomponents:httpclient:${httpclientVersion}"
testCompile('org.springframework.boot:spring-boot-starter-test')
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
}
2 changes: 1 addition & 1 deletion demos/sample-rest-stockapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"connected-react-router": "^4.4.1",
"emotion": "^9.2.6",
"emotion-theming": "^9.2.6",
"formik": "^1.3.0",
"formik": "~1.3.0",
"formik-material-ui": "^0.0.9",
"history": "^4.7.2",
"immutable": "^3.8.2",
Expand Down
Loading

0 comments on commit 1b5ac69

Please sign in to comment.