jbtrystram / coreos-hackathon

0 stars 1 forks source link

Migrate OpenShift workloads to non-deprecated APIs #13

Open dustymabe opened 3 weeks ago

dustymabe commented 3 weeks ago

We have several projects in Fedora's OpenShift that we rely on:

Most of them (if not all) are using outdated/deprecated constructs like DeploymentConfig. BuildConfig may be deprecated too. In all cases we need to update our projects to use new APIs/Objects so that they don't cease to work in the future.

c4rt0 commented 3 weeks ago

I just checked os docs for 4.17. I see that indeed, the DeploymentConfig, BuildConfig api endpoint and possibly other constructs are deprecated.

From the quick scroll through fedora-infra I see that for example coreos-koji-tagger as you mentioned uses deploymentconfig. I just wonder... how do I test this, in case I were to work on this issue? Any other pointers that could lead me to some clues?

dustymabe commented 3 weeks ago

each of the projects that we own should be deployable in the Fedora staging OpenShift.

I would say if you can even get pods running and builds building it would be enough. You don't have to verify that the service can come up completely.

c4rt0 commented 3 weeks ago

Just a comment to summarize my recent findings:

  1. Since we are still in F41 freeze, the PR's on pagure with changes most likely won't be merged by time our hackathon is finished.

  2. List of PR's related to the issue (may be updated)

  3. Related docs/links:

c4rt0 commented 2 weeks ago

Since one of the hackathon themes is 'AI', out of curiosity I asked (Yi Coder 9B LLM -> link to model download for LM Studio) about the ansible-linter complains: Question:

What is wrong with my code? Here's ansible linter complains:

var-naming[no-role-prefix]: Variables names from within roles should use object_ as a prefix. (vars: template)
playbooks/openshift-apps/fedora-ostree-pruner.yml:37

var-naming[no-role-prefix]: Variables names from within roles should use object_ as a prefix. (vars: objectname)
playbooks/openshift-apps/fedora-ostree-pruner.yml:38

role-name[path]: Avoid using paths when importing roles. (openshift/object)
playbooks/openshift-apps/fedora-ostree-pruner.yml:41

var-naming[no-role-prefix]: Variables names from within roles should use object_ as a prefix. (vars: app)
playbooks/openshift-apps/fedora-ostree-pruner.yml:42

var-naming[no-role-prefix]: Variables names from within roles should use object_ as a prefix. (vars: template)
playbooks/openshift-apps/fedora-ostree-pruner.yml:43

var-naming[no-role-prefix]: Variables names from within roles should use object_ as a prefix. (vars: objectname)
playbooks/openshift-apps/fedora-ostree-pruner.yml:44

role-name[path]: Avoid using paths when importing roles. (openshift/object)
playbooks/openshift-apps/fedora-ostree-pruner.yml:47

var-naming[no-role-prefix]: Variables names from within roles should use object_ as a prefix. (vars: app)
playbooks/openshift-apps/fedora-ostree-pruner.yml:48

var-naming[no-role-prefix]: Variables names from within roles should use object_ as a prefix. (vars: template)
playbooks/openshift-apps/fedora-ostree-pruner.yml:49

var-naming[no-role-prefix]: Variables names from within roles should use object_ as a prefix. (vars: objectname)
playbooks/openshift-apps/fedora-ostree-pruner.yml:50

role-name[path]: Avoid using paths when importing roles. (openshift/object-delete)
playbooks/openshift-apps/fedora-ostree-pruner.yml:56

Read documentation for instructions on how to ignore specific rule violations.

                      Rule Violation Summary                      
 count tag                        profile  rule associated tags   
     7 role-name[path]            basic    deprecations, metadata 
    18 var-naming[no-role-prefix] basic    idiom                  
     1 name[casing]               moderate idiom                  

Failed: 26 failure(s), 0 warning(s) on 1 files. Last profile that met the validation criteria was 'min'.

And the reply:

Assistant
Yi-Coder-9B-Chat-GGUF
The error messages indicate several issues with your code:

The variable naming convention in Ansible is to start all variable names (within a role) with object_ as a prefix. This encourages good practice of descriptive and meaningful variable naming which eases maintenance and readability of the code. The linter is complaining about variables named "template", "app", "objectname" etc on lines 37, 42-49.

In your roles you are using relative paths instead of role names. This is not recommended as it can lead to confusion and problems with the playbook structure when you have nested roles or complex dependencies. The linter is complaining about roles "openshift/object" on lines 41, 47 etc and "openshift/object-delete" on line 56.

To fix these issues:

Prefix all variables within a role with object_ as a prefix following the variable naming convention in Ansible.

Use role names instead of relative paths for importing roles. This can be done by replacing the relative path with the intended role name from your collection, if any. If no role collections are used then use the standard format galaxy_user/repo or role_name.

11.21 tok/sec
272 tokens
10.66s to first token
Stop: eosFound