ome / ansible-role-omero-web

Installs and configures OMERO.web and Nginx
BSD 2-Clause "Simplified" License
1 stars 14 forks source link

Try fixing build #45

Closed pwalczysko closed 1 year ago

pwalczysko commented 1 year ago

After some attempts at prod-playbooks trying to fix here as this is a simpler repo.

cc @sbesson @jburel

pwalczysko commented 1 year ago

Very similar expereince to prod-playbooks repo fixing - the https://github.com/ome/prod-playbooks/pull/370#issuecomment-1573594780 repeats here too.

sbesson commented 1 year ago

Looking at the error, I think you'll need https://github.com/IDR/deployment/commit/03cf8347e717201e89f5777c80210d68f06c643e - see https://github.com/ansible-community/molecule/issues/3903

pwalczysko commented 1 year ago

Thanks @sbesson , this fixed the error and I have some progress. Next step is failing with molecule not finding the roles. I think this is https://github.com/ansible-community/molecule/issues/3404 - but would you please have an insight how would I implement the fix https://github.com/ansible-community/molecule/discussions/3569 on my side ?

sbesson commented 1 year ago

Try the equivalent of https://github.com/ome/ansible-role-ssl-certificate/commit/10d5013ade3f3c9f22b716a3b4860deac57a8207 i.e. use the FQDN role name in the Molecule playbooks?

pwalczysko commented 1 year ago

Atm stuck at

the role 'ome.omero_common' was not found in ansible.legacy:/home/runner/work/ansible-role-omero-web/ansible-role-omero-web/molecule/resources/roles:/home/runner/.cache/ansible-compat/ae077f/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/runner/work/ansible-role-omero-web:/home/runner/work/ansible-role-omero-web/ansible-role-omero-web/molecule/resources```

it seems that https://github.com/ome/ansible-role-omero-web/pull/45/commits/6fe2254622ef4291960674f559c39227d54c6edc fixed the similar errror of missing role complaint for ome.omero_web as per @sbesson's hint, but for this ^^^ ome.omero_common the only idea I have is https://github.com/ansible/ansible-lint/issues/1387 - but again, lost in the implementation of solution. The pinning of the ansible-lint did not do it, and for all I can gather, the problem shoiuld not be there in newest ansible-lint...

Maybe the way forward would be for me to install from scratch https://molecule.readthedocs.io/installation/#pip and learn how to test the minimal set of scenarios ?

sbesson commented 1 year ago

Confusingly, I fear the error you have been trying to fix is not a fatal one. The same message is thrown in https://github.com/ome/ansible-role-postgresql/actions/runs/4446829141/jobs/7807628554 which is passing.

I think the critical error comes from the lint step above

Molecule active-ubuntu2004 > lint
./.github/workflows/molecule.yml
  Error: 38:81 [line-length] line too long (83 > 80 characters)

It might be worth fixing the dependency error in all cases to reduce the noise. Looking at the logs, the issue is that the role gets installed in the dependency phase under a folder named after the scenario

Molecule active-ubuntu2004 > dependency
  INFO     Running from /home/runner/work/ansible-role-omero-web/ansible-role-omero-web : ansible-galaxy collection install -vvv community.docker:>=3.0.2
  INFO     Running from /home/runner/work/ansible-role-omero-web/ansible-role-omero-web : ansible-galaxy collection install -vvv ansible.posix:>=1.4.0
  Starting galaxy role install process
  - downloading role 'omero_common', owned by ome
  - downloading role from https://github.com/ome/ansible-role-omero-common/archive/0.3.4.tar.gz
  - extracting ome.omero_common to /home/runner/.cache/molecule/ansible-role-omero-web/active-ubuntu[20](https://github.com/ome/ansible-role-omero-web/actions/runs/5178132773/jobs/9329184347?pr=45#step:5:21)04/roles/ome.omero_common
  - ome.omero_common (0.3.4) was installed successfully

but the lint step above looks into

syntax-check[specific]: the role 'ome.omero_common' was not found in ansible.legacy:/home/runner/work/ansible-role-omero-web/ansible-role-omero-web/molecule/resources/roles:/home/runner/.cache/ansible-compat/ae077f/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/runner/work/ansible-role-omero-web:/home/runner/work/ansible-role-omero-web/ansible-role-omero-web/molecule/resources

I have not checked what the best practice is

pwalczysko commented 1 year ago

I think now I am failing with

fatal: [omero-web-active-centos7]: FAILED! => {"changed": false, "cmd": "/bin/systemctl", "msg": "Failed to get D-Bus connection: No such file or directory", "rc": 1, "stderr": "Failed to get D-Bus connection: No such file or directory\n", "stderr_lines": ["Failed to get D-Bus connection: No such file or directory"], "stdout": "", "stdout_lines": []}

Maybe this is fixable by

I've set "deprecatedCgroupsv1": true in ~/Library/Group\ Containers/group.com.docker/settings.json and that fixed the issue

from https://github.com/geerlingguy/ansible-role-apache/issues/232#issuecomment-1019408795 - but again, how to implement it...

pwalczysko commented 1 year ago

Well, but maybe I am failing with

 Error: the role 'ome.omero_common' was not found in ansible.legacy:/home/runner/work/ansible-role-omero-web/ansible-role-omero-web/molecule/resources/roles:/home/runner/.cache/ansible-compat/ae077f/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/runner/work/ansible-role-omero-web:/home/runner/work/ansible-role-omero-web/ansible-role-omero-web/molecule/resources

now ? I can see those two errors (the one above in this comment and the one in https://github.com/ome/ansible-role-omero-web/pull/45#issuecomment-1578341478 - but which one is the failing one is not clear

pwalczysko commented 1 year ago

Ignoring the lint error as per Seb's comment

  Error: the role 'ome.omero_common' was not found in ansible.legacy:/home/runner/work/ansible-role-omero-web/ansible-role-omero-web/molecule/resources/roles:/home/runner/.cache/ansible-compat/ae077f/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/runner/work/ansible-role-omero-web:/home/runner/work/ansible-role-omero-web/ansible-role-omero-web/molecule/resources

   We have now 3 different errors from the three tests (centos7, ubuntu1804, ubuntu2004)

centos7:

     TASK [ome.nginx : nginx | running] *********************************************
  fatal: [omero-web-active-centos7]: FAILED! => {"changed": false, "cmd": "/bin/systemctl", "msg": "Failed to get D-Bus connection: No such file or directory", "rc": 1, "stderr": "Failed to get D-Bus connection: No such file or directory\n", "stderr_lines": ["Failed to get D-Bus connection: No such file or directory"], "stdout": "", "stdout_lines": []}

ubuntu18.04

fatal: [omero-web-active-ubuntu1804]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key export 8B3981E7A6852F782CC4951600A6F0A3C300EE8C", "msg": "E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation", "rc": 255, "stderr": "E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation\n", "stderr_lines": ["E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation"], "stdout": "", "stdout_lines": []}

ubuntu2004

fatal: [omero-web-active-ubuntu2004]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo ~/.ansible/tmp `\"&& mkdir \"` echo ~/.ansible/tmp/ansible-tmp-1686053961.4233685-5165-28687435618548 `\" && echo ansible-tmp-1686053961.4233685-5165-28687435618548=\"` echo ~/.ansible/tmp/ansible-tmp-1686053961.4233685-5165-28687435618548 `\" ), exited with result 1", "unreachable": true}

imhho

cc @khaledk2

pwalczysko commented 1 year ago

All jobs in the buid are green now. cc @sbesson @jburel

pwalczysko commented 1 year ago

In summary, the level of testing is as it was before this PR. Did not have to remove any tests. Will see if similar tactics will work also with the other ansible repos (not probable) - but for the moment, I do not see a reason for announcing the deprecation of testing, at least not on this repo @sbesson

pwalczysko commented 1 year ago

A few inline questions. A more general one is whether the Ubuntu 18.04 scenario should be kept at all since this OS is EOL and there is really no driver to keep supporting it to the best of my knowledge

Fixed in https://github.com/ome/ansible-role-omero-web/pull/45/commits/483c38581f378e740eded8b3a17e5791df0ad4e7

pwalczysko commented 1 year ago

@jburel Do you want to merge ?