kiwix / operations

Kiwix Kubernetes Cluster
http://charts.k8s.kiwix.org/
5 stars 0 forks source link

Rollout mwoffliner 1.14 on farm.openzim.org #214

Open benoit74 opened 6 days ago

benoit74 commented 6 days ago

See https://github.com/openzim/zimfarm/issues/988

Below statement assumes there is no requested tasks ongoing, otherwise the table must be updated accordingly.

Check statement:

SELECT id, config::jsonb -> 'flags' ->> 'mwApiPath' as mwApiPath, config::jsonb -> 'flags' ->> 'mwActionApiPath' as mwActionApiPath
FROM schedule
WHERE config::jsonb -> 'image' ->> 'name' = 'ghcr.io/openzim/mwoffliner'
AND config::jsonb -> 'flags' ->> 'mwActionApiPath' is null
AND config::jsonb -> 'flags' ->> 'mwApiPath' is not null;

Update statement:

UPDATE schedule SET config = jsonb_set(config::jsonb, '{flags, mwActionApiPath}', config::jsonb -> 'flags' ->> 'mwApiPath') #- '{flags, mwApiPath}'
WHERE config::jsonb -> 'image' ->> 'name' = 'ghcr.io/openzim/mwoffliner'
AND config::jsonb -> 'flags' ->> 'mwActionApiPath' is null
AND config::jsonb -> 'flags' ->> 'mwApiPath' is not null;
benoit74 commented 6 days ago

Enable/Disable mwoffliner currently enabled recipes

Temp table to keep data:

create table _maint_mwoffliner_1_14 (
  id uuid,
  schedulename character varying
);

Populate temp table:

INSERT INTO _maint_mwoffliner_1_14
SELECT id, name
FROM schedule
WHERE enabled = TRUE
AND config::jsonb -> 'image' ->> 'name' = 'ghcr.io/openzim/mwoffliner';

Check

SELECT id, enabled, config::jsonb -> 'image' ->> 'name' AS image_name, config::jsonb -> 'image' ->> 'tag' AS image_tag
FROM schedule
WHERE id in (SELECT id FROM _maint_mwoffliner_1_14)

Disable

UPDATE schedule
SET enabled = FALSE
WHERE id in (SELECT id FROM _maint_mwoffliner_1_14);

Cleanup temp table:

drop table _maint_mwoffliner_1_14;
benoit74 commented 6 days ago

@kelson42 @audiodude all mwoffliner recipes in Zimfarm are now disabled.

We still have two mwoffliner tasks running: https://farm.openzim.org/pipeline/b4f58539-454b-4d6d-8392-e1504a7a382b and https://farm.openzim.org/pipeline/94167b91-8b89-41de-a351-6287bab02c49

Once finished, @rgaudin will purge S3 cache for mwoffliner

rgaudin commented 5 days ago

Ping me when I should

kelson42 commented 5 days ago

@rgaudin If all mwoffliner recipes are suspended an task running, then pkease purge the S3 cache