##// END OF EJS Templates
release of new installer/docker stack updates...
release of new installer/docker stack updates Tons of changes to move towards new rccontrol docker stack based installer

File last commit:

r23:ffcea5dc
r23:ffcea5dc
Show More
README.md
297 lines | 9.4 KiB | text/x-minidsrc | MarkdownLexer
docker: added all the initial docker files...
r1 # RhodeCode Cluster
release of new installer/docker stack updates...
r23 RhodeCode Cluster is a multi-node highly-scalable setup to run
RhodeCode, Edge Router(Traefik + SSL) and Metrics Stack (Prometheus, Loki, Grafana) and
docker: added all the initial docker files...
r1 all its additional components in single environment using Docker.
Using a docker-compose this setup creates following services for RhodeCode:
release of new installer/docker stack updates...
r23 Edge-Router:
- Traefik, Edge Router, SSL termination etc
Core Services:
- Database (defaults to PostgreSQL)
- Redis, acts as cache and queue exchange
- ChannelStream - live websocket communications
- Nginx (static/channelstream) proxy serving RhodeCode APPS and channelstream communication
- Elasticsearch (full text search backend)
RhodeCode
- RhodeCode CE/EE
- VCSServer for GIT/SVN/HG support
- SSH Server for cloning over SSH
- SVN webserver for HTTP support over SVN
- Celery workers for asynchronous tasks
- Celery beat for automation tasks
Metrics
- Loki, logs aggregation
- Grafana, Metrics Dashboard
- Promethues, Metrics time-series
- statsd-exporter - statsd to promethues bridge
- node-exporter - machine stats
- promtail - log scraping
docker: added all the initial docker files...
r1
## Pre requisites
release of new installer/docker stack updates...
r23 To Run this stack Docker engine and Docker Compose needs to be installed on the host machine.
docker: added all the initial docker files...
r1 Visit docker site and install docker (min version 20.10) and docker compose:
release of new installer/docker stack updates...
r23 - https://docs.docker.com/engine/install/
- https://docs.docker.com/compose/install/
docker: added all the initial docker files...
r1
env: updated env file...
r9 The instructions below outline installation of the current stable release (v1.29.2) of Compose.
docker: added all the initial docker files...
r1
docker: updated to 4.25.0
r4 ## Data structure
There are 4 volumes defined:
- `/etc/rhodecode/conf`
release of new installer/docker stack updates...
r23 Shared volume used for configuration files for rhodecode, vcsserver and supervisord, and some cache data
docker: updated to 4.25.0
r4
- `/var/opt/rhodecode_repo_store`
release of new installer/docker stack updates...
r23 Used for main repository storage where repositories would be stored
docker: updated to 4.25.0
r4
- `/var/opt/rhodecode_data`
release of new installer/docker stack updates...
r23 Data dir for rhodecode cache/lock files, or user sessions (for file backend)
docker: updated to 4.25.0
r4
- `/var/log/rhodecode`
release of new installer/docker stack updates...
r23 Used to store all logs from RhodeCode
docker: updated to 4.25.0
r4
## Setup/Build options
There are 3 options to run the docker stack.
- [Standalone cluster build from installer](#standalone-cluster-build-from-installer)
docker-setup...
r8 - [Standalone cluster build from source](#standalone-cluster-build-from-source)
release of new installer/docker stack updates...
r23 - [dev environment setup](#dev-env-build)
docker: updated to 4.25.0
r4
# Standalone cluster build from installer
Readme: added notice about users should clone this repository....
r2
docker: added all the initial docker files...
r1 Follow these steps to build and run the RhodeCode Cluster via Docker-compose.
Readme: added notice about users should clone this repository....
r2 Get the repository:
git clone https://code.rhodecode.com/rhodecode-enterprise-docker && cd rhodecode-enterprise-docker
initial commit
r0
## Download installer binaries
First start by fetching required installer binaries. This is required to create both
simple build and full compose setup.
Bumped services and rhodecode to 4.27.0
r12 Please check the `.env` file to adjust RhodeCode version if needed.
(e.g. RC_VERSION="4.24.1")
initial commit
r0
docker: updated to 4.25.0
r4 ```shell
docker-setup...
r8 cd .bootstrap/ && ./download-artifacts.sh && cd ../
docker: updated to 4.25.0
r4 ```
initial commit
r0
Bumped services and rhodecode to 4.27.0
r12 This will download required installer files and put them into the `.cache` directory.
docker: added all the initial docker files...
r1 This directory should look similar to that after downloads have finish:
```shell
drwxr-xr-x 8 rcdev rcdev 256B Feb 8 13:35 .
drwxr-xr-x 14 rcdev rcdev 448B Feb 8 10:40 ..
-rw-r--r-- 1 rcdev rcdev 0B Feb 8 20:44 .dirkeep
-rwxr-xr-x 1 rcdev rcdev 241M Feb 8 13:35 RhodeCode-installer-linux-build20210208_0800
-rw-r--r-- 1 rcdev rcdev 156M Feb 8 13:35 RhodeCodeCommunity-4.24.1+x86_64-linux_build20210208_0800.tar.bz2
-rw-r--r-- 1 rcdev rcdev 171M Feb 8 13:35 RhodeCodeEnterprise-4.24.1+x86_64-linux_build20210208_0800.tar.bz2
-rw-r--r-- 1 rcdev rcdev 145M Feb 8 13:35 RhodeCodeVCSServer-4.24.1+x86_64-linux_build20210208_0800.tar.bz2
-rw-r--r-- 1 rcdev rcdev 109M Feb 8 13:35 locale-archive
```
initial commit
r0
docker: added all the initial docker files...
r1 ## Set License for EE version
initial commit
r0
release of new installer/docker stack updates...
r23 In order to install EE edition a license file is required to be present.
It can contain your current license, or when empty license can be applied via Web interface.
Bumped services and rhodecode to 4.27.0
r12 To apply it during build phase save your raw license data into a file
env: updated env file...
r9
release of new installer/docker stack updates...
r23 `config/rhodecode_enterprise.license`
env: updated env file...
r9
If this file is present build phase will read it and license will be applied at creation.
This file can also be empty and license can be applied via a WEB interface after first login.
docker: added all the initial docker files...
r1
## Run Docker compose build:
initial commit
r0
docker-setup...
r8 *This will build RhodeCode based on downloaded installer packages.*
initial commit
r0 To create a full stack we need to run the database container, so it's ready to
build the docker image.
Bumped services and rhodecode to 4.27.0
r12 _Disk space problems?_
```shell
docker system df
docker builder prune
release of new installer/docker stack updates...
r23 # optionally
docker image prune -a
Bumped services and rhodecode to 4.27.0
r12 ```
release of new installer/docker stack updates...
r23 ### Creating & building images
Bumped services and rhodecode to 4.27.0
r12
initial commit
r0 1) start with running the required database for the build stage in the background.
```shell
docker-compose up --detach database
```
docker: updated to 4.25.0
r4 This will start our postgres database, and expose it to the network.
release of new installer/docker stack updates...
r23 Postgres DB is configured to output logs into a file `/var/log/rhodecode/postgres`
docker: updated to 4.25.0
r4
2) We can now run the full installation. Database needs to be running for the next build command.
release of new installer/docker stack updates...
r23 This will build the rhodecode base image used for rhodecode, vcsserver, celery, ssh, svn
Then it will build all other components required.
initial commit
r0 ```shell
docker: added all the initial docker files...
r1 docker-compose build rhodecode
docker-compose build
initial commit
r0 ```
release of new installer/docker stack updates...
r23 4) Once we build all required containers, we can run the whole stack using `docker-compose up`
docker: updated to 4.25.0
r4
```shell
docker-compose up
```
initial commit
r0
docker-setup...
r8 If running locally you can access Running RhodeCode via Nginx under:
initial commit
r0 http://localhost:8888
docker-setup...
r8 localhost can be changed to the server IP where docker is running.
initial commit
r0
In case for bigger setups docker-compose can scale more rhodecode/vcsserver workers:
```shell
docker-compose up --scale vcsserver=3 rhodecode=3
```
release of new installer/docker stack updates...
r23 Logging is pushed to stdout from all services.
docker: added all the initial docker files...
r1
release of new installer/docker stack updates...
r23 ### Upgrade procedure:
docker: added all the initial docker files...
r1
docker-setup...
r8 - pull the latest rhodecode-docker repo
docker: added all the initial docker files...
r1 - check .env file for correct update version
- re-build rhodecode
- docker-compose build rhodecode
release of new installer/docker stack updates...
r23 - docker-compose build
docker: added all the initial docker files...
r1 - docker-compose stop
- docker-compose up
docker: updated to 4.25.0
r4 # Standalone cluster build from source
docker: added all the initial docker files...
r1
release of new installer/docker stack updates...
r23 There's an option to build the latest release from the source code as a docker installation.
If you have the 3 required projects source code already, the next step can be omitted, and the
sources can be copied to the `.source/` directory. note: symlinks don't work.
docker-setup...
r8
release of new installer/docker stack updates...
r23 - https://code.rhodecode.com/rhodecode-vcsserver
- https://code.rhodecode.com/rhodecode-enterprise-ce
- https://code.rhodecode.com/rhodecode-enterprise-ee (assuming access is granted to this)
Download the source using bootstrap script:
docker: added all the initial docker files...
r1
docker: updated to 4.25.0
r4 ```shell
docker-setup...
r8 cd .boostrap/ && ./download-source.sh && cd ../
docker: updated to 4.25.0
r4 ```
docker: added all the initial docker files...
r1
docker-setup...
r8 This step will create source code copies into the `.source/` path. e.g
```
-rw-r--r-- 1 docker docker 0 Nov 25 12:27 .dirkeep
drwxr-xr-x 1 docker docker 1184 Nov 25 12:27 rhodecode-enterprise-ce
drwxr-xr-x 1 docker docker 1120 Nov 25 12:27 rhodecode-enterprise-ee
drwxr-xr-x 1 docker docker 800 Nov 25 12:27 rhodecode-vcsserver
```
release of new installer/docker stack updates...
r23 With this done, you can now proceed with every step of normal source installation (Creating & building images), but instead of using
just `docker-compose` command it needs to be replaced with `docker-compose -f docker-compose.yaml -f docker-compose.source.yaml`
docker-setup...
r8
release of new installer/docker stack updates...
r23 For example to override the installer build with the source `rhodecode` based image, and also setting proper version, run:
docker: added all the initial docker files...
r1
docker: updated to 4.25.0
r4 ```shell
release of new installer/docker stack updates...
r23 RC_VERSION="4.27.0.REL202221020" docker-compose -f docker-compose-apps.yaml -f docker-compose.source.yaml build --no-cache --progress=plain rhodecode
docker: updated to 4.25.0
r4 ```
docker: added all the initial docker files...
r1
release of new installer/docker stack updates...
r23 NOTE THAT it's recommended to keep rc_version and source_Ver the same
initial commit
r0
## Simple build
Build docker RhodeCode `Community` without any dependencies (redis, external db) using
simple sqlite database and file based caches.
This is a fully running instance good for small use with 3-5 users.
```shell
release of new installer/docker stack updates...
r23 docker build -t rhodecode/rhodecode-ce:4.23.2 -f rhodecode.dockerfile \
docker: added all the initial docker files...
r1 -e RHODECODE_TYPE=Community \
-e RHODECODE_VERSION=4.23.2 \
-e RHODECODE_DB=sqlite \
-e RHODECODE_USER_NAME=admin \
-e RHODECODE_USER_PASS=secret4 \
-e RHODECODE_USER_EMAIL=support@rhodecode.com \
initial commit
r0 .
```
note: for debugging better to add `--progress plain` into the build command to obtain all the output from the build.
To Build against existing running Postgres or MySQL you can specify:
--build-arg RHODECODE_DB=postgresql://postgres:secret@database/rhodecode
--build-arg RHODECODE_DB=mysql://root:secret@localhost/rhodecode?charset=utf8
To copy over the data into volumes use such command:
```shell
docker run -v logvolume:/data --name data_vol busybox true
docker cp . data_vol:/data
docker rm data_vol
```
Run the container, mounting the required volumes. By default the application would be
available at http://localhost:10020, and default login is (unless specified differently in the build command)
```
user: admin
password: secret4
```
We've not built our image using specific version. It's time to run it:
release of new installer/docker stack updates...
r23 We specify the run.ini by selecting config option we have locally
initial commit
r0
```shell
docker run \
--name rhodecode-container \
--publish 10020:10020 \
--restart unless-stopped \
--volume $PWD/config:/etc/rhodecode/conf \
release of new installer/docker stack updates...
r23 --volume $PWD/config/rhodecode.optimized.ini:/etc/rhodecode/conf_build/run.ini \
initial commit
r0 --volume $PWD/logs:/var/log/rhodecode \
release of new installer/docker stack updates...
r23 'rhodecode/rhodecode-ee:4.23.2'
initial commit
r0 ```
Enter container
```shell
docker exec -it rhodecode-container /bin/bash
```
Enter interactive shell
```shell
release of new installer/docker stack updates...
r23 docker exec -it rhodecode-container /usr/local/bin/rhodecode_bin/bin/rc-ishell /etc/rhodecode/conf/rhodecode.ini
initial commit
r0 ```
Run Database migrations
```shell
release of new installer/docker stack updates...
r23 docker exec -it rhodecode-container /usr/local/bin/rhodecode_bin/bin/rc-upgrade-db /etc/rhodecode/conf/rhodecode.ini --force-yes
```
### Registry for docker swarm
docker run -d -p 5000:5000 --restart always --name registry registry:2