Skip to content

Commit

Permalink
Merge pull request #14 from KillrVideo/no-etcd
Browse files Browse the repository at this point in the history
Kubernetisation Rework
  • Loading branch information
HadesArchitect authored Aug 9, 2019
2 parents 6ee9038 + 8e858bc commit 8e73109
Show file tree
Hide file tree
Showing 40 changed files with 1,326 additions and 3,476 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ node_modules
.env

# Webstorm/IDEA
.idea
.idea
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
language: node_js
node_js:
- "8"

# Sudo required for doing docker build
sudo: required
services:
- docker

# Build the app and a docker image
script:
- docker build -t ${TRAVIS_COMMIT} .

# If successful, see if we need to publish also
after_success:
- test -z $TRAVIS_TAG && travis_terminate 0
- docker tag ${TRAVIS_COMMIT} killrvideo/killrvideo-nodejs:${TRAVIS_TAG}
- echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
- docker push killrvideo/killrvideo-nodejs:${TRAVIS_TAG}

env:
global:
# DOCKER_USER
- secure: hL9GzKnAuHP130bLzB1nK9eF6bfPD4yFdQ1IdRRp7QDZ+AJ2MUw483w5Uacw6/VNk+KlItO9ySxkAI8gaBcxjxcp+TmFkmD0o4rRQixCoZiqlNeTCMmkx5J6KffNALiFBFPjOvVNXLEYh6lbyIsPJR0/eHGlhCbfpx9Ok9PxzVV4AtNNXVcqCl4hZFWPU8OX7nL0pyQ86MD1WiC/1nfTaE/9zaZ8M/qJhv558KmsSXnFN1eGrwVJLt8XPbZ5aKEvJq3cngwVJ3/hmMQnA6ScgANZFbFrDZo9gDmQLDAbGzQ4mg1wpmvdCGB9HEo14o+ZK3utmnURZDGLHcbgKitIp7fd+FyIktxF3h+hYm7yMV/P67ixLXWxay9F0XXkKF1CPhRU+uEijcWQY/txUItvfHJtDGQbHhChUPmzv2eTQD5QoevFByZ6c3ekQew6hgCPaOsV2FspQQ+XVtdjiiOzmWzeFux2Obc46K85BSyeEp9SjuTJ0772dFBZjWn9UP+M5B8THs4BNPhkSVhceHQBvv65H8DZYEazue0aJYwJhMd1qx5tq/3dXItyDVqxCj0J0LFI4TsFbSf4R+snYOxjc2dkpO1l9aZyLNBTbRn//MTki8o/tdIjAzNYKKWHHBWCYN7OU4Ej4t7XI/SKs3Wf131ebqLlTYU0ppJD7KQUvCU=
# DOCKER_PASS
- secure: hxakhOfACkkXcGc5T9cT0+a+ICw6X2ybsOXzJsgdju4QbdP0nD2iBSZCypDzfdzlF/y83yJGcSznegMega37ABomPd8BF04IJTY1ZSvfj8LiUiLLfo/YSsz68r/X1G/AxVmS/7x9x5xaCPMnCHaH2jK5Qiogawzlqgqw/h3EAQlnJyKdjwwmFpATUAuRJidQ/95pn4KYvERg3eZ7/DzqbAO4IRjSuxHRNqDsHXDR4xlBxXAwqt0SE9qfr8rIbuA264vwStltPi4RDfTWWBooxFTGWHpu7rS/N1xEg7+48Il0zckVqmbwMJeAfl8abXhqK5RRrpv77icHeqxi5bev/SL28PnNOhj5gXn6a4/1/JPuhzmKp1omNtlJsjjZhs7YidSOVQ2nEJjDoeQ9/d+Z+g6DosnkDbiS7+ijvIPD9SlRbyUlf7Z3wD8Hf91/fUgkaUoIVkBUFvW8i0fArfcWSIQErvixIGhj41yNOwIAheUFM4Y39NsuilJZZmqZ2Zh0/9AHUiY4fA7C6CajFC06CpjUCpDhb3m0uy1vJcUiG7Y3J6iTrRzaW8eqPnGBQcVTS7/dXPj3WtEP/xOF93sYeZMKE7hk489WAUJNLV9kmasSaVTzbu80kfM5Ml9m675dN3ztUAhaAPT0IqHnycngMBKe2Y7+EDalsDBsffOpO0k=
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:8
WORKDIR /usr/src/app

COPY . .

RUN npm install --unsafe-perm
RUN npm run build

CMD node dist/index.js
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ A reference application for Node.js developers looking to learn more about using
[Apache Cassandra][cassandra] and [DataStax Enterprise][dse] in their applications and
services. Learn more at [killrvideo.github.io][killrvideo].

## Running Locally
## Running Locally using Docker

Use these guides to get started running KillrVideo locally on your development machine:
Running should be pretty straight-forward if you are familiar with docker and docker-compose

* [Getting Started with KillrVideo][getting-started]: Follow this to setup common dependencies
like Docker.
* [Getting Started with Node.js][getting-started-node]: Follow this to get this Node.js code
running.
```
> docker-compose pull
> docker-compose build
> docker-compose up -d
```

## Contributing, Requests for More Examples

Expand All @@ -26,4 +27,4 @@ open an issue here on GitHub or send a message to [@LukeTillman][twitter] on Twi
[killrvideo]: https://killrvideo.github.io/
[getting-started]: https://killrvideo.github.io/getting-started/
[getting-started-node]: https://killrvideo.github.io/docs/languages/nodejs/
[twitter]: https://twitter.com/LukeTillman
[twitter]: https://twitter.com/LukeTillman
37 changes: 37 additions & 0 deletions config/services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"services": {
"web": [
"web:3000"
],
"cassandra": [
"dse"
],
"dse-search": [
"dse:8983"
],
"UploadsService": [
"backend:50101"
],
"RatingsService": [
"backend:50101"
],
"CommentsService": [
"backend:50101"
],
"SearchService": [
"backend:50101"
],
"StatisticsService": [
"backend:50101"
],
"VideoCatalogService": [
"backend:50101"
],
"UserManagementService": [
"backend:50101"
],
"SuggestedVideoService": [
"backend:50101"
]
}
}
82 changes: 49 additions & 33 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,63 @@
version: '3'

# Other services are specified in .\lib\killrvideo-docker-common\docker-compose.yaml
services:
# Start the KillrVideo web UI on port 3000
# NodeJS Backend
backend:
build: .
volumes:
- .:/usr/src/app
depends_on:
- dse
env_file: ./killrvideo.env
environment:
NODE_ENV: development

# Datastax Enterprise
dse:
image: datastax/dse-server:6.7.0
command: [ -s -g ]
ports:
- "9042:9042"
- "8983:8983"
- "8182:8182"
env_file: ./killrvideo.env
environment:
DS_LICENSE: accept
# Allow DSE to lock memory with mlock
cap_add:
- IPC_LOCK
ulimits:
memlock: -1

# Frontend
web:
image: killrvideo/killrvideo-web:1.2.6
image: killrvideo/killrvideo-web:3.0.0-rc1
env_file: ./killrvideo.env
ports:
- "3000:3000"
- "3000:3000"
depends_on:
- dse
- etcd
environment:
SERVICE_3000_NAME: web
KILLRVIDEO_ETCD: "etcd:2379"
KILLRVIDEO_DSE_USERNAME: $KILLRVIDEO_DSE_USERNAME
KILLRVIDEO_DSE_PASSWORD: $KILLRVIDEO_DSE_PASSWORD
KILLRVIDEO_CASSANDRA_REPLICATION: $KILLRVIDEO_CASSANDRA_REPLICATION
KILLRVIDEO_LOGGING_LEVEL: $KILLRVIDEO_LOGGING_LEVEL
- dse

# DSE Configurator to setup DSE
dse-config:
image: killrvideo/killrvideo-dse-config:3.0.0-rc1
env_file: ./killrvideo.env
depends_on:
- dse

# The sample data generator
# Sample Data Generator
generator:
image: killrvideo/killrvideo-generator:1.2.4
image: killrvideo/killrvideo-generator:3.0.0-rc4
env_file: ./killrvideo.env
depends_on:
- dse
- etcd
environment:
KILLRVIDEO_ETCD: "etcd:2379"
KILLRVIDEO_DSE_USERNAME: $KILLRVIDEO_DSE_USERNAME
KILLRVIDEO_DSE_PASSWORD: $KILLRVIDEO_DSE_PASSWORD
NODE_ENV: $NODE_ENV
KILLRVIDEO_CASSANDRA_REPLICATION: $KILLRVIDEO_CASSANDRA_REPLICATION
KILLRVIDEO_LOGGING_LEVEL: $KILLRVIDEO_LOGGING_LEVEL
- dse
- backend

# One instance of DataStax Studio
# DataStax Studio
studio:
image: killrvideo/killrvideo-studio:2.0.0
image: datastax/dse-studio:6.7.0
ports:
# The Web UI exposed to our host
- "9091:9091"
- "9091:9091"
depends_on:
- dse
- dse
environment:
SERVICE_9091_NAME: studio
DS_LICENSE: accept


4 changes: 4 additions & 0 deletions killrvideo.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
KILLRVIDEO_DSE_USERNAME=cassandra
KILLRVIDEO_DSE_PASSWORD=cassandra
KILLRVIDEO_LOGGING_LEVEL=debug
DS_LICENSE: accept
4 changes: 0 additions & 4 deletions lib/killrvideo-docker-common/.gitignore

This file was deleted.

Loading

0 comments on commit 8e73109

Please sign in to comment.