Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 storage (not to be merged) #26

Open
wants to merge 78 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
8d7ab1d
fix typo
Feb 15, 2017
fd8edfe
fix problem with abstraction of file system
Feb 16, 2017
0f41f66
fix double /
Feb 21, 2017
b0c9210
final touches - credits and settings.yml
Feb 21, 2017
1940c18
merge with moovel s3
Feb 21, 2017
6487a23
Merge branch 's3-storage' of https://github.com/takipi/takipi-storage…
Feb 21, 2017
939fd19
Update README.md
shimonmagal Feb 21, 2017
46dcf5c
add support for docker for s3
Feb 23, 2017
2cb1f9f
config env support
davidlevanon Feb 28, 2017
f7bfe14
Merge pull request #22 from takipi/s3-storage-i/support-remote-source…
davidlevanon Mar 28, 2017
1023874
Added support for using IAM Roles.
Jul 19, 2017
4df29e7
Merge branch 'develop' of https://github.com/takipi/takipi-storage in…
Aug 1, 2017
de9bd45
adjust README and Dockerfile comments
Aug 1, 2017
f414fab
https support in settings.yml
Aug 1, 2017
33655ba
style and formatting
Aug 1, 2017
988773e
add support for path prefix for s3
Aug 2, 2017
dd21946
add support for not passing credentials for s3
Aug 2, 2017
6471e31
add support for not passing credentials for s3
Aug 2, 2017
32b0ac7
credits
Aug 2, 2017
d11e4cc
Merge branch 's3-storage-i/support-remote-sources' into s3-storage-i/…
shimonmagal Aug 2, 2017
c59c04e
Merge pull request #25 from llimon/s3-storage-i/support-remote-sources
shimonmagal Aug 2, 2017
a965c60
readme file
Aug 3, 2017
955b182
standards
Aug 6, 2017
750f8a6
remove all warnings
Aug 6, 2017
56408b2
overrides
chook Aug 7, 2017
b06c88e
Merge pull request #21 from takipi/s3-storage-i/support-remote-sources
chook Aug 8, 2017
fbc315d
added concurrency and caching to multi fetch
mervyn2017 Oct 1, 2017
bfbbfd5
Extracted the S3 cache to an external class and added a dummy cache a…
mervyn2017 Oct 2, 2017
277a7b3
Extracted the S3 cache to an external class and added a dummy cache a…
mervyn2017 Oct 2, 2017
bb49a50
Extracted the S3 cache to an external class and added a dummy cache a…
mervyn2017 Oct 2, 2017
c6af41a
some refactoring
mervyn2017 Oct 2, 2017
8750dd9
base multifetcher type on file system type
mervyn2017 Oct 2, 2017
a8437da
some refactoring
mervyn2017 Oct 2, 2017
5a41856
more refactoring
mervyn2017 Oct 2, 2017
8090d3d
more refactoring
mervyn2017 Oct 2, 2017
4521700
more refactoring
mervyn2017 Oct 2, 2017
936bf9b
more refactoring
mervyn2017 Oct 3, 2017
532a656
more refactoring
mervyn2017 Oct 3, 2017
448febd
Downgraded code from Java 8 to Java 7
mervyn2017 Oct 3, 2017
24b0a25
Added cache size and max number of threads to the yml file in order t…
mervyn2017 Oct 8, 2017
6f60d81
Added cache size and max number of threads to the yml file in order t…
mervyn2017 Oct 8, 2017
c681d98
changed some default configuration settings
mervyn2017 Oct 8, 2017
3cb3719
changed some default configuration settings
mervyn2017 Oct 8, 2017
14aa38a
changed logger class
mervyn2017 Oct 8, 2017
bd9ba47
changed default max cache size
mervyn2017 Oct 9, 2017
0e7b121
changed logger level from info to debug in a few places
mervyn2017 Oct 10, 2017
3648114
refactoring and changed default setting to disable caching.
mervyn2017 Oct 16, 2017
ae0e2fd
removed caching and extracted the concurrent task executor to a gener…
mervyn2017 Oct 17, 2017
15e298a
changed tabs to spaces and a small refactoring.
mervyn2017 Oct 17, 2017
17814a4
always execute first task in the calling thread
mervyn2017 Oct 18, 2017
1077a9e
mini refactor
davidlevanon Oct 18, 2017
0dff438
logging refactor
davidlevanon Oct 19, 2017
567b274
Merge pull request #27 from takipi/feature/8050/add-multifetch-concur…
davidlevanon Oct 19, 2017
b735c20
added caching
mervyn2017 Oct 22, 2017
04971c3
added caching
mervyn2017 Oct 23, 2017
75920fd
added caching
mervyn2017 Oct 23, 2017
69525eb
Increase the concurrent thread executor max threads to 500.
mervyn2017 Oct 24, 2017
1056ac9
small refactor
mervyn2017 Oct 30, 2017
aed7581
small refactor
mervyn2017 Oct 30, 2017
570e216
removed thread limit for ConcurrentTaskExecutor and did a small refac…
mervyn2017 Oct 31, 2017
7ab567f
modified logs
mervyn2017 Oct 31, 2017
ff1ce11
refactoring.
mervyn2017 Nov 1, 2017
d37a36d
added option of CacheLogger and some small refactorings.
mervyn2017 Nov 2, 2017
f2fce4b
added maven guava dependency
mervyn2017 Nov 2, 2017
d8e4608
added max batch size and updated settings.yml
mervyn2017 Nov 5, 2017
67d5914
code review minor changes
mervyn2017 Nov 6, 2017
68e6194
Merge pull request #29 from takipi/feature/8857/speed-up-of-silver-nu…
davidlevanon Nov 8, 2017
6b733da
merge from deveop
davidlevanon Nov 30, 2017
a58ef3d
enable nullable
Jan 18, 2018
8238c56
handle missing keys
Jan 19, 2018
a03bc4a
Merge branch 's3-storage' of https://github.com/takipi/takipi-storage…
Jan 19, 2018
79f5179
remove comments
davidlevanon Jan 21, 2018
898acb4
Merge pull request #32 from takipi/feature/handle-missing-keys
davidlevanon Jan 21, 2018
66e79ef
downgrade
Jan 22, 2018
c352bb7
downgrade
Jan 22, 2018
40affe0
Merge pull request #33 from takipi/feature/downgrade
davidlevanon Jan 23, 2018
7b81bfe
[OOE-273] Updating Dockerfile to use consistent rootless docker image…
cseverino789 Jan 12, 2021
ab4ed1a
Update to use Virtual Repository on Jfrog
cseverino789 Jan 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
550 changes: 275 additions & 275 deletions .settings/org.eclipse.jdt.core.prefs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
Takipi Storage
==============

Thanks to Moovel for developing this version supporting s3: https://github.com/moovel/takipi-storage/tree/s3-storage
And to Atlassian for adding some extra features

Build and run:
- clone the repo
- `cd takipi-storage`
- `mvn compile package`
- edit settings.yml to contain bucket, key, secret to access your s3 bucket
- `java -jar target/takipi-storage-1.7.0.jar server settings.yml`

Deploy:
Expand Down
44 changes: 29 additions & 15 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
# Run me with docker run -v <host-path-to-storage>:/opt/takipi-storage/storage -p <host_port>:$STORAGE_PORT
# Logs are written to <storage>/log folder and both should be persistent outside of the running container
FROM openjdk:8-jre-slim
LABEL maintainer="[email protected]"

FROM java:8
MAINTAINER Chen harel "https://github.com/chook"
ARG APP_VERSION=latest

ENV VERSION 1.7.0
ENV TAR_FILENAME takipi-storage-$VERSION.tar.gz
ENV JAR_FILENAME takipi-storage-$VERSION.jar
ENV STORAGE_PORT 8080
# install curl
RUN apt-get update; apt-get install -y curl

RUN wget https://s3.amazonaws.com/app-takipi-com/deploy/takipi-storage/$TAR_FILENAME
RUN tar zxvf $TAR_FILENAME -C /tmp && \
mkdir -p /opt/takipi-storage/lib && \
cp /tmp/takipi-storage/lib/$JAR_FILENAME /opt/takipi-storage/lib
ADD settings.yml /opt/takipi-storage
# rootless
RUN groupadd --gid 1000 overops
RUN adduser --home /opt/takipi-storage --uid 1000 --gid 1000 overops
USER 1000:1000

EXPOSE $STORAGE_PORT
# install into the /opt directory
WORKDIR /opt

# download and install the storage server
RUN curl -sL http://app-takipi-com.s3.amazonaws.com/deployx/s3/deploy/takipi-storage/takipi-storage-${APP_VERSION}.tar.gz | tar -xvzf -

RUN mkdir /opt/takipi-storage/private
COPY --chown=1000:1000 "./private/settings.yaml" "/opt/takipi-storage/private/settings.yaml"

# use mount to make settings.yaml available
VOLUME ["/opt/takipi-storage/private"]

WORKDIR /opt/takipi-storage
CMD java -jar /opt/takipi-storage/lib/$JAR_FILENAME server settings.yml

# copy the run script
COPY --chown=1000:1000 "./scripts/run.sh" "./run.sh"
RUN chmod +x run.sh

EXPOSE 8080 8081

# run the service, printing logs to stdout
CMD ["./run.sh"]
72 changes: 72 additions & 0 deletions docker/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
def imageName = 'docker/overops-storage-server-s3'
def dockerHubImage = 'overops/storage-server-s3'

pipeline {

environment {
registryCred = 'container-registry-build-guy'
dockerhubCred = 'docker-hub'
gitCred = 'build-guy'
}

parameters {
string(name: 'VERSION', defaultValue: 'latest', description:'Application version')
string(name: 'TAG', defaultValue: 'latest', description:'Image Tag to be used')
booleanParam(name: 'PUBLISH_TO_DOCKERHUB', defaultValue: false, description:'Flag to publish to docker-hub')
}

agent any
stages {
stage('Cloning Git') {
steps {
git([url: 'https://github.com/takipi/takipi-storage', branch: 's3-storage', credentialsId: gitCred])
}
}

stage('Build Docker Image') {
steps {
dir('docker') {
script {
if (params.PUBLISH_TO_DOCKERHUB) {
imageName = dockerHubImage
}

dockerOptions = ('--label=storage-server-s3-pipeline --build-arg APP_VERSION=' + params.VERSION + ' .')
dockerImage = docker.build(imageName, dockerOptions)
}
}
}
}

stage('Publish Docker Image') {
steps {
script {
if (params.PUBLISH_TO_DOCKERHUB) {
reg = ''
cred = dockerhubCred
} else {
reg = env.LOCAL_DOCKER_REGISTRY_URL
cred = registryCred
}

docker.withRegistry(reg, cred) {
dockerImage.push()

if (params.TAG != 'latest') {
dockerImage.push(params.TAG)
}
}
}
}
}

stage('Cleanup') {
steps {
script {
sh(script:"docker rmi -f \$(docker images -f label=storage-server-s3-pipeline -q)")
}
cleanWs()
}
}
}
}
21 changes: 17 additions & 4 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
takipi-storage on docker
========================
# Deploy the Storage Server - S3 (hybrid installations, AWS S3)

When running takipi-storage inside docker, make sure to persist the storage folder outside (using volumes).
For hybrid installations, the Storage Server can be installed in your cluster.

Logs are placed inside the storage folder
This Storage Server [Dockerfile](Dockerfile) is based on the [Installing the Storage Server on AWS S3](https://doc.overops.com/docs/installing-the-storage-server-on-aws-s3) guide, with some minor modifications.

For complete instructions on performing a hybrid installation, refer to the [Hybrid Installation on Linux](https://doc.overops.com/docs/linux-hybrid-installation) guide.

The file `settings.yaml` must be mounted into the `/opt/takipi-storage/private` directory to run this container. An example [settings.yaml](private/settings.yaml) can be found in this repo.

## Quick Start

This image is on Docker Hub: [overops/storage-server-s3](https://hub.docker.com/r/overops/storage-server-s3)

### Docker Quick Start

```console
docker run -d -p 8080:8080 --mount type=bind,source="$(pwd)"/private,target=/opt/takipi-storage/private overops/storage-server-s3
```
45 changes: 45 additions & 0 deletions docker/private/settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
enableCors: true
corsOrigins: "*"

# If using attaching IAM Role to instance leave accessKey and secretKey empty.
s3Fs:
bucket: <BUCKET_NAME>
pathPrefix: <FOLDER_IN_BUCKET>
credentials:
accessKey: <AWS_ACCESS_KEY>
secretKey: <AWS_SECRET_KEY>

multifetch:
# maximum number of threads for concurrent multi-fetch. Set to zero to disable concurrent fetching.
concurrencyLevel: 100
# Recommended size >= 16777216. Set to zero to disable caching.
maxCacheSize: 67108864
enableCacheLogger: false
maxBatchSize: 4194304

server:
gzip:
includedMethods: [POST, GET]
applicationConnectors:
- type: http
port: 8080
# https support
# - type: https
# port: 8443
# keyStorePath: example.keystore
# keyStorePassword: example
# validateCerts: false
adminConnectors:
- type: http
port: 8081

# Logging settings.
logging:
# The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL.
level: INFO
# Logger-specific levels.
loggers:
com.takipi: DEBUG

appenders:
- type: console
3 changes: 3 additions & 0 deletions docker/scripts/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
java -jar /opt/takipi-storage/lib/takipi-storage.jar server /opt/takipi-storage/private/settings.yaml &> /opt/takipi-storage/log/takipi-storage.log &
/usr/bin/tail -f /opt/takipi-storage/log/takipi-storage.log
27 changes: 0 additions & 27 deletions docker/settings.yml

This file was deleted.

14 changes: 12 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- use UTF-8 for everything -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<dropwizard.version>1.2.2</dropwizard.version>
<dropwizard.version>0.7.1</dropwizard.version>
<dropwizard-debpkg-maven-plugin.version>0.7</dropwizard-debpkg-maven-plugin.version>
</properties>
<dependencies>
Expand All @@ -30,6 +30,16 @@
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.11.13</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>17.0</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -98,7 +108,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.4</version>
</plugin>
</plugins>
</reporting>
Expand Down
33 changes: 28 additions & 5 deletions settings.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
folderPath: /opt/takipi-storage/storage
maxUsedStoragePercentage: 0.95
enableCors: true
corsOrigins: "*"

# If using attaching IAM Role to instance leave accessKey and secretKey empty
s3Fs:
bucket: <bucket>
pathPrefix: <path_prefix>
credentials:
accessKey: <key>
secretKey: <secret>

multifetch:

# maximum number of threads for concurrent multi-fetch. Set to zero to disable concurrent fetching.
concurrencyLevel: 100

# Recommended size >= 16777216. Set to zero to disable caching.
maxCacheSize: 67108864

enableCacheLogger: false

maxBatchSize: 4194304

#folderFs:
# folderPath: /opt/takipi-storage/storage
# maxUsedStoragePercentage: 0.95


server:
gzip:
includedMethods: [POST, GET]
Expand All @@ -11,9 +34,9 @@ server:
applicationConnectors:
- type: http
port: 8080
# this requires the alpn-boot library on the JVM's boot classpath
# - type: spdy3
# port: 8445
# https support
# - type: https
# port: 8443
# keyStorePath: example.keystore
# keyStorePassword: example
# validateCerts: false
Expand Down
Loading