Skip to content

Commit d627b15

Browse files
committed
v9.3 Controller Changes:
- Callbacks added to API - Moved ACME validation IP to availability zones - Added Backups and Volume API endpoints - Added region and availability zone information in project and services api. - Added YJIT and JEMALLOC to controller container for better memory management. - Improvements to the development environment, including support for ARM. See full changelog (v9.1.2..v9.3.0) for full details of changes.
1 parent d957779 commit d627b15

File tree

96 files changed

+1679
-488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1679
-488
lines changed

.gitlab-ci.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ workflow:
77
when: never
88
- when: always
99

10-
##
11-
# Set at job
12-
# CS_MINOR_VERSION
13-
# CS_MAJOR_VERSION
1410
variables:
11+
DOCKER_TLS_CERTDIR: "/certs"
12+
FF_NETWORK_PER_BUILD: "true"
1513
FULL_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID
14+
POSTGRES_DB: cstacks
15+
POSTGRES_USER: cstacks
16+
POSTGRES_PASSWORD: cstacks
17+
REDIS_HOST: redis
18+
DATABASE_URL: "postgres://cstacks:cstacks@postgres/cstacks"
19+
CS_MINOR_VERSION: "9.3"
20+
CS_MAJOR_VERSION: "9"
1621

1722
default:
18-
tags:
19-
- shell
23+
image: docker:25
2024
before_script:
2125
- echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin
2226
after_script:
@@ -25,20 +29,15 @@ default:
2529

2630
stages:
2731
- build
28-
- deploy
2932

3033
build:
3134
stage: build
32-
before_script:
33-
- 'docker run -d --rm --name cstacks-pg -e POSTGRES_USER=cstacks -e POSTGRES_DB=cstacks -e POSTGRES_PASSWORD=cstacks postgres:16'
34-
- 'docker run -d --rm --name cstacks-redis --network "container:cstacks-pg" redis:alpine'
35-
after_script:
36-
- docker stop cstacks-redis cstacks-pg
37-
script:
38-
- 'docker build --network "container:cstacks-pg" --progress plain --build-arg github_user=$GITHUB_GEM_PULL_USER --build-arg github_token=$GITHUB_GEM_PULL_TOKEN -t $FULL_IMAGE .'
39-
deploy:
40-
stage: deploy
35+
services:
36+
- docker:25-dind
37+
- postgres:16
38+
- redis:alpine
4139
script:
40+
- "docker build --network=host --add-host=redis:$(getent hosts redis | awk '{ print $1 }') --add-host=postgres:$(getent hosts postgres | awk '{ print $1 }') --cache-from $CI_REGISTRY_IMAGE:$CS_MAJOR_VERSION --progress plain --build-arg db_url=$DATABASE_URL --build-arg redis_host=$REDIS_HOST -t $FULL_IMAGE ."
4241
- "docker tag $FULL_IMAGE $CI_REGISTRY_IMAGE:$CS_MINOR_VERSION"
4342
- "docker tag $FULL_IMAGE $CI_REGISTRY_IMAGE:$CS_MAJOR_VERSION"
4443
- "docker tag $FULL_IMAGE $CI_REGISTRY_IMAGE:latest"

.rubocop.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
Metrics/AbcSize:
2+
Enabled: False
3+
Metrics/ClassLength:
4+
Enabled: false
5+
Metrics/CyclomaticComplexity:
6+
Enabled: false
17
Metrics/LineLength:
28
Max: 100
9+
Metrics/MethodLength:
10+
Max: 100
11+
Metrics/PerceivedComplexity:
12+
Enabled: false
313
Style/TernaryParentheses:
414
Enabled: false
515
Layout/FirstParameterIndentation:
@@ -14,3 +24,4 @@ Layout/SpaceInsideParens:
1424
Enabled: false
1525
Layout/SpaceInsideArrayLiteralBrackets:
1626
Enabled: false
27+

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.3
1+
3.3.0

CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,57 @@
11
# Change Log
22

3+
## v9.3.0
4+
5+
- [FEATURE] Introducing Callbacks for the API. This allows you to receive a webhook from ComputeStacks when a api request is completed by a background worker.
6+
- [FEATURE] Move acme validation IP to a database field on the region. This allows different IPs for different regions.
7+
8+
## v9.2.2
9+
10+
- [FEATURE] Added volume and backups api.
11+
12+
## v9.2.1
13+
14+
- [FEATURE] `on_latest_image` Boolean field added to container and bastion api calls. If false, there is a new image on the node and a rebuild will use the new image.
15+
16+
## v9.2.0
17+
18+
**YJIT and JEMALLOC for ComputeStacks Production Environments**
19+
20+
Please add the following to your `/etc/default/computestacks` file:
21+
22+
```
23+
MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true,stats_print:false
24+
RUBY_YJIT_ENABLE=1
25+
```
26+
27+
And download the latest `cstacks` helper script onto the controller with this command:
28+
29+
```bash
30+
wget -O /usr/local/bin/cstacks https://raw.githubusercontent.com/ComputeStacks/ansible-install/main/roles/controller/files/cstacks.sh \
31+
&& chmod +x /usr/local/bin/cstacks
32+
```
33+
34+
Please see[v92 Notes.md](./doc/v92 Notes.md) for more details.
35+
36+
**Major Changes to the development environment**
37+
38+
This release includes major changes to how our development environment is configured.
39+
40+
- The controller, postgres, and redis are now run by calling `docker compose up -d` locally on your development machine. This means you'll need to have docker installed locally.
41+
- Our vagrant image is now much closer to a production compute node, in that it only runs the containers as a node and no longer runs any of the controller.
42+
- The controller's gemfile no longer pulls the gem from Github, but just does a git clone. This removes the requirement of having a github account to build the controller.
43+
44+
See [DEV_SETUP.md](./doc/DEV_SETUP.md) for specific instructions.
45+
46+
***
47+
48+
* [CHANGE] Upgrade ruby to 3.3, and rails to 7.1, and fix deprecations and bugs introduced with this upgrade.
49+
* [CHANGE] Remove Rails.secrets in favor of environmental variables.
50+
* [CHANGE] Disable marketplace reporting. This project is on an indefinite hold.
51+
* [FIX] Updated monarx integration to resolve api issues.
52+
53+
***
54+
355
## v9.1.2
456

557
* [FIX] Don't attempt node evacuation with local networking.

Dockerfile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
FROM ruby:3.2
1+
FROM ruby:3.3
22

33
LABEL maintainer="https://github.com/ComputeStacks"
44
LABEL org.opencontainers.image.authors="https://github.com/ComputeStacks"
55
LABEL org.opencontainers.image.source="https://github.com/ComputeStacks/controller"
66
LABEL org.opencontainers.image.url="https://github.com/ComputeStacks/controller"
77
LABEL org.opencontainers.image.title="ComputeStacks Controller"
88

9+
ARG db_url="postgresql://cstacks:cstacks@localhost/cstacks?pool=30"
10+
ARG redis_host=localhost
11+
12+
ENV DATABASE_URL=$db_url
13+
ENV REDIS_HOST=$redis_host
14+
915
ENV RACK_ENV=production
1016
ENV RAILS_ENV=production
1117
ENV SECRET_KEY_BASE=3a698257a1e32f1bb9b3fd861640c3b53cc9c57dd40b3fa360fed44d2e5da3fdb3351db2f8c881f2a04e6a7ca7e721de67d98061ffa7d394d3ad1c24ce9e09ec
1218
ENV USER_AUTH_SECRET=3a698257a1e32f1bb9b3fd861640c3b53cc9c57dd40b3fa360fed44d2e5da3fdb3351db2f8c881f2a04e6a7ca7e721de67d98061ffa7d394d3ad1c24ce9e09ec
1319
ENV LOCALE=en
1420
ENV CURRENCY=USD
15-
ENV DATABASE_URL="postgresql://cstacks:cstacks@localhost/cstacks?pool=30"
16-
ENV REDIS_HOST=localhost
1721
ENV RUBYOPT='-W:no-deprecated'
1822
ENV APP_ID=build
1923

20-
ARG github_user
21-
ARG github_token
22-
2324
RUN set -ex; \
2425
\
2526
apt-get update; \
@@ -62,14 +63,11 @@ WORKDIR /usr/src/app
6263
ADD Gemfile* /usr/src/app/
6364
ADD engines/ /usr/src/app/engines/
6465

65-
RUN bundle config https://rubygems.pkg.github.com/ComputeStacks $github_user:$github_token \
66-
&& bundle config set without 'test development' \
67-
; \
68-
cd /usr/src/app \
69-
&& if [ ! -f Gemfile ]; then mv Gemfile.common Gemfile; fi \
70-
&& bundle install \
71-
; \
72-
bundle config --delete https://rubygems.pkg.github.com/computestacks/
66+
RUN bundle config set without 'test development' \
67+
; \
68+
cd /usr/src/app \
69+
&& if [ ! -f Gemfile ]; then mv Gemfile.common Gemfile; fi \
70+
&& bundle install
7371

7472
COPY lib/build/nginx.conf /etc/nginx/sites-enabled/default
7573
COPY lib/build/supervisord.conf /etc/supervisord.conf

Gemfile.common

Lines changed: 49 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,81 @@
1-
ruby "~> 3.2"
1+
# vim syntax=ruby
2+
ruby "~> 3.3"
23

34
source 'https://rubygems.org'
45

5-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
6+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
67

7-
gem 'timeout', '= 0.3.2'
8+
gem 'timeout', '~> 0.4'
89

9-
gem 'rails', '= 7.0.6'
10-
gem 'json', '= 2.6.3'
10+
gem 'rails', '~> 7.1'
11+
gem 'json', '~> 2.7'
1112

1213
# Redis
1314
gem "hiredis", "< 1"
1415
gem "redis", "< 6"
1516
gem 'redis-client', '< 1' # sidekiq
1617

17-
gem 'rack-attack', '~> 6.6'
18+
gem 'rack-attack', '~> 6.7'
1819

1920
gem 'tzinfo-data' # No source of timezone data could be found. (TZInfo::DataSourceNotFound)
2021

2122
gem 'rake', '= 13.0.6'
2223
gem 'sprockets', '= 4.2.0'
2324
gem 'sprockets-rails', '= 3.4.2'
2425
gem 'importmap-rails', '~> 1'
25-
gem 'pg', '= 1.5.3', platform: :ruby
26+
gem 'pg', '= 1.5.5', platform: :ruby
2627

2728
gem 'httparty', '= 0.21.0' # @deprecated for httprb
28-
gem 'http', '= 5.1.1'
29+
gem 'http', '~> 5.2'
2930

30-
gem 'geoip', '= 1.6.4'
31+
gem 'geoip', '~> 1'
3132

32-
gem 'will_paginate', '= 3.3.1'
33-
gem 'api-pagination', '= 5.0.0'
33+
gem 'will_paginate', '~> 4'
34+
gem 'api-pagination', '~> 5'
3435

35-
gem 'money-rails', '= 1.15.0'
36-
gem 'whois', '= 5.1.0'
36+
gem 'money-rails', '~> 1'
37+
gem 'whois', '~> 5'
3738

3839
gem 'sidekiq', '< 8'
3940
gem 'sidekiq-unique-jobs', '< 9'
4041

4142
# Logging
42-
gem 'lograge', '= 0.12.0'
43+
gem 'lograge', '~> 0.14'
4344

4445
# Authentication
45-
gem 'devise', '= 4.9.2'
46-
gem 'bcrypt', '= 3.1.18'
46+
gem 'devise', '= 4.9.3'
47+
gem 'bcrypt', '= 3.1.20'
4748

48-
gem "doorkeeper", "= 5.6.6"
49+
gem "doorkeeper", "= 5.6.9"
4950

50-
gem 'rotp', '= 6.2.2'
51-
gem 'rqrcode', '= 2.1.2'
52-
gem 'webauthn', '= 3.0.0'
51+
gem 'rotp', '~> 6.3'
52+
gem 'rqrcode', '~> 2.2'
53+
gem 'webauthn', '~> 3.1'
5354

5455
gem 'clockwork', '= 3.0.2'
5556
gem 'http_accept_language', '= 2.1.1'
5657

5758
gem 'nokogiri', '~> 1'
5859

59-
gem 'country_select', '= 8.0.1'
60-
gem 'responders', '= 3.1.0'
60+
gem 'country_select', '~> 9'
61+
gem 'responders', '~> 3.1'
6162

6263
gem 'daemons', '= 1.4.1'
6364
gem 'net-smtp'
64-
gem 'slim', '= 5.1.0'
65-
# gem 'uglifier', '= 4.2.0'
65+
gem 'slim', '~> 5.2'
6666

67-
gem 'chartkick', '= 5.0.2'
68-
gem 'groupdate', '= 6.2.1'
67+
gem 'chartkick', '~> 5'
68+
gem 'groupdate', '~> 6'
6969

70-
gem 'ssh_data', '= 1.3.0' # Generate & Validate SSH Keys
71-
gem 'net-ssh', '= 7.1.0'
72-
gem 'ed25519', '= 1.3.0'
73-
gem 'bcrypt_pbkdf', '= 1.1.0' # Support ed25519 ssh keys for net-ssh.
74-
gem 'highline', '= 2.1.0' # Hide PW entered into net-ssh from logs and output.
70+
gem 'ssh_data', '~> 1' # Generate & Validate SSH Keys
71+
gem 'net-ssh', '~> 7'
72+
gem 'ed25519', '~> 1.3'
73+
gem 'bcrypt_pbkdf', '~> 1.1' # Support ed25519 ssh keys for net-ssh.
74+
gem 'highline', '~> 3' # Hide PW entered into net-ssh from logs and output.
7575

7676
# Markdown Support
77-
gem 'github-markup', '= 4.0.1'
78-
gem 'redcarpet', '= 3.6.0', platform: :ruby
77+
gem 'github-markup', '~> 4.0'
78+
gem 'redcarpet', '~> 3.6', platform: :ruby
7979

8080

8181
gem "sentry-ruby"
@@ -86,26 +86,26 @@ gem 'sass-rails', '= 6.0.0'
8686
gem 'bootstrap-sass', '= 3.4.1'
8787

8888
gem 'rabl', '= 0.16.1'
89-
gem 'oj', '= 3.14.3', platform: :ruby
90-
gem 'jwt', '= 2.7.0'
89+
gem 'oj', '= 3.16.3', platform: :ruby
90+
gem 'jwt', '= 2.8.0'
9191

9292
# LetsEncrypt
93-
gem 'acme-client', '= 2.0.13'
93+
gem 'acme-client', '= 2.0.17'
9494

9595
gem 'versioncake', '= 4.1.1'
9696

9797
# Console
9898
gem 'pry'
9999
gem 'pry-rails'
100100

101-
gem 'diplomat', '= 2.6.4'
101+
gem 'diplomat', '~> 2.6'
102102

103-
gem 'fugit', '= 1.8.1'
104-
gem 'zaru', '= 1.0.0'
103+
gem 'fugit', '~> 1.9'
104+
gem 'zaru', '~> 1.0'
105105

106-
gem 'acts-as-taggable-on', '= 9.0.1'
106+
gem 'acts-as-taggable-on', '~> 10.0'
107107

108-
gem 'liquid', '= 5.4.0' # Used to generate variables in custom commands
108+
gem 'liquid', '~> 5.4' # Used to generate variables in custom commands
109109

110110
##
111111
# Used by CAA check to determine TLD for a domain.
@@ -139,15 +139,13 @@ group :test do
139139
gem 'webmock'
140140
end
141141

142-
source "https://rubygems.pkg.github.com/computestacks" do
143-
gem "autodns", "2.1.1"
144-
gem "docker_registry", "0.3.4"
145-
gem "docker_ssh", "0.7.1"
146-
gem "docker_volume_local", "0.2.5"
147-
gem "docker_volume_nfs", "0.2.7"
148-
gem "pdns", "1.1.1"
149-
gem "whmcs", "2.3.7"
150-
end
151-
142+
# ComputeStack Gems
143+
gem 'autodns', github: 'ComputeStacks/autodns-ruby', ref: 'd045f63'
152144
gem 'docker-api', github: 'ComputeStacks/docker-api', ref: '499e609'
145+
gem 'docker_registry', github: 'ComputeStacks/docker-registry-ruby', ref: 'b69fb48'
146+
gem 'docker_ssh', github: 'ComputeStacks/docker-ssh-ruby', ref: '0b01ab8'
147+
gem 'docker_volume_local', github: 'ComputeStacks/docker-volume-local', ref: 'b6f066a'
148+
gem 'docker_volume_nfs', github: 'ComputeStacks/docker-volume-nfs', ref: '2614c82'
149+
gem 'pdns', github: 'ComputeStacks/powerdns-ruby', ref: '21a31b9'
150+
gem 'whmcs', github: 'ComputeStacks/whmcs-ruby', ref: '7dc4f4e'
153151

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9.1.2
1+
9.3.0

Vagrantfile.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Vagrant.configure("2") do |config|
1010
config.vm.provider :libvirt do |vm|
1111
vm.driver = "kvm"
1212
vm.title = "computestacks"
13-
vm.description = "ComputeStacks Controller"
13+
vm.description = "ComputeStacks Node"
1414
vm.memory = 4096
1515
vm.cpus = 4
1616
vm.cputopology sockets: "1", cores: "2", threads: "2"

app/controllers/admin/regions_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ def region_create_params
5252
params.require(:region).permit(
5353
:name, :active, :fill_to, :metric_client_id, :loki_endpoint, :log_client_id, :loki_retries, :loki_batch_size,
5454
:volume_backend, :nfs_remote_host, :nfs_remote_path, :offline_window, :failure_count, :nfs_controller_ip,
55-
:disable_oom, :pid_limit, :ulimit_nofile_hard, :ulimit_nofile_soft, :location_id, :p_net_size, :network_driver
55+
:disable_oom, :pid_limit, :ulimit_nofile_hard, :ulimit_nofile_soft, :location_id, :p_net_size, :network_driver, :acme_server
5656
)
5757
end
5858

5959
def region_update_params
6060
params.require(:region).permit(
6161
:active, :fill_to, :metric_client_id, :loki_endpoint, :log_client_id, :loki_retries, :loki_batch_size,
6262
:volume_backend, :nfs_remote_host, :nfs_remote_path, :offline_window, :failure_count, :nfs_controller_ip,
63-
:disable_oom, :pid_limit, :ulimit_nofile_hard, :ulimit_nofile_soft, :p_net_size, :network_driver
63+
:disable_oom, :pid_limit, :ulimit_nofile_hard, :ulimit_nofile_soft, :p_net_size, :network_driver, :acme_server
6464
)
6565
end
6666

0 commit comments

Comments
 (0)