Migrate to agent based k8s integration
Description
This PR is to migrate k8s integration to agent based integration for deploying to k8s cluster. The task is to migrate whatever we have now as it is without adding additional functionality.
Related JIRA Issue(s)
https://www.ebi.ac.uk/panda/jira/browse/ENSWBSITES-2495
Review App URL(s)
None
Knowledge Base
Gitlab Agent : https://docs.gitlab.com/ee/user/clusters/agent/
YAML Anchors: https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html
Example(s)
Pipeline with example showing the dev context https://gitlab.ebi.ac.uk/ensembl-web/ensembl_search_hub/-/pipelines/504135
Dependencies
None
Merge request reports
Activity
requested review from @andres and @mcharkhchi
requested review from @andrey
22 22 Docker: 23 23 extends: .build 24 24 25 # Production beta.ensembl.org 26 Prod:WP40:HL: 25 # Production : beta.ensembl.org 26 Prod: 27 27 extends: .deploy 28 28 <<: *deploy-rules What do the magic chars
<<
*
do and how does it differ from array notation (extends: - deploy - depoy-rules
)?Edited by Andres VeidenbergThe above recommends using the
extends
array over yaml magic chars. Here is combination of both. Is it itentional?Edited by Andres VeidenbergThe extends is extending deploy template. which largely remains as it is across different. With YAML anchors you can have additional conditions. Say for staging we want to deploy from dev branch ( I know here it is not the case). Or for review we want to add branching rules.
So Its composition of multiple things with extends you will have to well defined template. You can achieve same thing with extends but then you will need to have multilevel extends.
Again purpose of this PR is to have agent based integration.
I commented on this code part because it was not clear to me what and why was done here. You can add branch rules with extends (see example here) which is clearer and recommended approach.
I'll approve this MR but please consider switching to extends array (see the first comment in this thread).
@andres Yes, Agree. We will have to make it consistent across all the API but I would rather do it in the separate PR than here. I will add this to the list of Backend Priority. Also, its fair to say that if we plan to move to GitOps or something entire deploy section would be irrelevant. That is why I suggested its a good thing but needs its own dedicated task/discission. Thanks
Edited by Kamal Dodiya
14 14 - if: '$CI_DEPLOY_FREEZE == null && $CI_COMMIT_BRANCH == "master"' 15 15 when: always 16 16 17 17 .deploy-template-branches: &deploy-rules-branches This template doesn't seem to be used anywhere. Can you add a job for deploying feature branches to review apps to have an example of how is it done with the agent-based system? Thanks!
Edited by Andres Veidenberg
See this test pipeline https://gitlab.ebi.ac.uk/ensembl-web/ensembl_search_hub/-/pipelines/504135
The pipeline uses code not included in this MR. Can you add a link to that code?
Edited by Andres VeidenbergSelf-reply: Here's the deployment job in the example pipeline.
Edited by Andres Veidenberg
mentioned in commit e1cef18b