Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollout mwoffliner 1.14 on farm.openzim.org #214

Open
benoit74 opened this issue Jul 1, 2024 · 9 comments
Open

Rollout mwoffliner 1.14 on farm.openzim.org #214

benoit74 opened this issue Jul 1, 2024 · 9 comments
Assignees
Labels
maint Maintenance tasks

Comments

@benoit74
Copy link
Collaborator

benoit74 commented Jul 1, 2024

See openzim/zimfarm#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
Copy link
Collaborator Author

benoit74 commented Jul 1, 2024

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
Copy link
Collaborator Author

benoit74 commented Jul 1, 2024

@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
Copy link
Member

rgaudin commented Jul 2, 2024

Ping me when I should

@kelson42
Copy link
Contributor

kelson42 commented Jul 2, 2024

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

@benoit74
Copy link
Collaborator Author

Bucket is now purged. It is possible to delete all files in a bucket at once from the UI by deleting the bucket itself.
What I did:

  • rename old bucket
  • create new empty bucket with old bucket settings
  • delete old bucket (with force delete of files inside)

@benoit74
Copy link
Collaborator Author

DB has been updated to use new flag name.
Only things left are:

@rgaudin
Copy link
Member

rgaudin commented Jul 15, 2024

Good ; I imagine this feature (bucket removal with files in it) has been added since our last attempt. Very good to know.

@benoit74
Copy link
Collaborator Author

Zimfarm PR openzim/zimfarm#992 has been merged. Work is now in mwoffliner team hands.

@kelson42 @audiodude please inform us when you are ready to configure 1.14 on all recipes + reactivate all recipes.

@kelson42
Copy link
Contributor

@benoit74 Thx, we will request your help to migrate recipes when we will be that far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maint Maintenance tasks
Projects
None yet
Development

No branches or pull requests

3 participants