Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Commit

Permalink
support separate Docker image for streaming, introduced in v4.3.0b1
Browse files Browse the repository at this point in the history
  • Loading branch information
ushitora-anqou committed Aug 25, 2024
1 parent 101b991 commit 9276468
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 66 deletions.
7 changes: 7 additions & 0 deletions charts/mahout/templates/mahout.anqou.net_mastodons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ spec:
additionalProperties:
type: string
type: object
image:
type: string
replicas:
type: integer
resources:
Expand Down Expand Up @@ -332,6 +334,11 @@ spec:
properties:
migratingImage:
type: string
streaming:
properties:
migratingImage:
type: string
type: object
type: object
type: object
served: true
Expand Down
20 changes: 11 additions & 9 deletions e2e/e2e.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[@@@warning "-32"]

module Logg = Mahout.Logg

exception Process_status_error of Unix.process_status * string * string
Expand Down Expand Up @@ -195,7 +197,7 @@ let () =
Mahout.Logg.setup ~enable_trace:false @@ fun () ->
setup ();

apply_manifest "mastodon0-v4.1.9.yaml";
apply_manifest "mastodon0-v4.2.12.yaml";

eventually (fun () ->
wait_deploy_available ~n:"e2e" "mastodon0-gateway-nginx";
Expand All @@ -222,14 +224,14 @@ let () =

http_get "http://mastodon0-gateway.e2e.svc/health" |> ignore;
check_mastodon_version ~host:"mastodon.test"
~endpoint:"http://mastodon0-gateway.e2e.svc" ~expected:"4.1.9";
check_schema_migrations_count ~expected:395;
~endpoint:"http://mastodon0-gateway.e2e.svc" ~expected:"4.2.12";
check_schema_migrations_count ~expected:422;
());

apply_manifest "mastodon0-v4.2.0.yaml";
apply_manifest "mastodon0-v4.3.0b1.yaml";

eventually (fun () ->
check_schema_migrations_count ~expected:417;
check_schema_migrations_count ~expected:460;
());

eventually (fun () ->
Expand All @@ -239,8 +241,8 @@ let () =
wait_deploy_available ~n:"e2e" "mastodon0-web";
http_get "http://mastodon0-gateway.e2e.svc/health" |> ignore;
check_mastodon_version ~host:"mastodon.test"
~endpoint:"http://mastodon0-gateway.e2e.svc" ~expected:"4.2.0";
check_schema_migrations_count ~expected:422;
~endpoint:"http://mastodon0-gateway.e2e.svc" ~expected:"4.3.0-beta.1";
check_schema_migrations_count ~expected:468;
());

apply_manifest "patched-gateway-nginx-conf.yaml";
Expand Down Expand Up @@ -276,13 +278,13 @@ let () =
~endpoint:"http://mastodon0-gateway.e2e.svc" ~expected:"ja");

(* Check that the web and sidekiq Pods are restarted periodically *)
apply_manifest "mastodon0-v4.2.0-restart.yaml";
apply_manifest "mastodon0-v4.3.0b1-restart.yaml";
eventually (fun () -> check_pod_age ~component:"web" ~smaller_than:30);
consistently (fun () -> check_pod_age ~component:"web" ~smaller_than:90);
eventually (fun () -> check_pod_age ~component:"sidekiq" ~smaller_than:30);
consistently (fun () -> check_pod_age ~component:"sidekiq" ~smaller_than:90);

delete_manifest "mastodon0-v4.2.0.yaml";
delete_manifest "mastodon0-v4.3.0b1.yaml";
eventually (fun () ->
wait_not_found ~n:"e2e" "deploy" "mastodon0-gateway-nginx";
wait_not_found ~n:"e2e" "deploy" "mastodon0-sidekiq";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ metadata:
namespace: e2e
spec:
serverName: "mastodon.test"
image: "ghcr.io/mastodon/mastodon:v4.1.9"
image: "ghcr.io/mastodon/mastodon:v4.2.12"
envFrom:
- secretRef:
name: secret-env
gateway:
replicas: 1
annotations:
test.mahout.anqou.net/role: gateway
image: "nginx:1.25.4"
image: "nginx:1.27.1"
resources:
requests:
cpu: 100m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@ metadata:
namespace: e2e
spec:
serverName: "mastodon.test"
image: "ghcr.io/mastodon/mastodon:v4.2.0"
image: "ghcr.io/mastodon/mastodon:4.3.0b1"
envFrom:
- secretRef:
name: secret-env
gateway:
replicas: 1
annotations:
test.mahout.anqou.net/role: gateway
image: "nginx:1.25.4"
image: "nginx:1.27.1"
sidekiq:
replicas: 1
annotations:
test.mahout.anqou.net/role: sidekiq
periodicRestart:
schedule: "* * * * *"
streaming:
image: "ghcr.io/mastodon/mastodon-streaming:4.3.0b1"
replicas: 1
annotations:
test.mahout.anqou.net/role: streaming
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ metadata:
namespace: e2e
spec:
serverName: "mastodon.test"
image: "ghcr.io/mastodon/mastodon:v4.2.0"
image: "ghcr.io/mastodon/mastodon:4.3.0b1"
envFrom:
- secretRef:
name: secret-env
gateway:
replicas: 1
annotations:
test.mahout.anqou.net/role: gateway
image: "nginx:1.25.4"
image: "nginx:1.27.1"
sidekiq:
replicas: 1
annotations:
test.mahout.anqou.net/role: sidekiq
streaming:
image: "ghcr.io/mastodon/mastodon-streaming:4.3.0b1"
replicas: 1
annotations:
test.mahout.anqou.net/role: streaming
Expand Down
3 changes: 3 additions & 0 deletions e2e/manifests/secret-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ stringData:
OTP_SECRET: 6918a831578526187b1cb90b13f9ca8b61bf2bbd6157a2dd86b0c210fb786e6829bfd1f11a832599357f456eef15366a5cca64667cc1af3ca2c88fdc4957ec9e
VAPID_PRIVATE_KEY: nAORcefIJBAo8cooVvpNiCPkJdAuTfEwj8t6x7xM_5M=
VAPID_PUBLIC_KEY: BK3jtGQpbtHwweeQK6wbJeqxs9movecCQt8npuxwMY5kAUnQlCeD-J-fPPlrNyBJdV-BGK2NywiD_uP9nH6hdC4=
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY: FCaKumtnNzfMGKD2Pr5PdoN406rhrNy4
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT: PgohNObnhUarZtbpD62OyWeAoP2EMtOM
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY: OgngAqpeQQsHDcr17BnMselEsjasoypZ
5 changes: 3 additions & 2 deletions lib/mastodon.ml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ include K.Make (Bare)
let make = Net_anqou_mahout.V1alpha1.Mastodon.make

module Status = struct
let with_migrating_image x _status =
Net_anqou_mahout.V1alpha1.Mastodon.Status.{ migrating_image = x }
let with_migrating_image x status =
Net_anqou_mahout.V1alpha1.Mastodon.Status.
{ status with migrating_image = x }
end
Loading

0 comments on commit 9276468

Please sign in to comment.