mantidproject / dockerfiles

Docker images relating to Mantid
https://hub.docker.com/u/mantidproject/
GNU General Public License v3.0
3 stars 7 forks source link

Create Ansible Playbook for Deploying to macOS #67

Open cailafinn opened 1 year ago

cailafinn commented 1 year ago

Also adds some documentation to fill in the gaps that can't be completed by Ansible.

Testing

  1. Follow the instructions in the documentation added in the PR. This will be a test of those instructions as much as the playbook.

Resolves #62

perenon commented 1 year ago

Hi, we spent some time with @eurydice76 to test this PR on a local machine. This machine is pretty old (OS stuck on Monterrey).

First, to run ansible, we had to set up a SSH key pair between the account running ansible and the mantidbuilder account. It was mandatory and never worked otherwise.

Then, the homebrew configuration was strange (flawed), so the installation of git and java11 through ansible was not working. We had to modify the ownership of many folders on our machine, and install git and java11 manually on the mantidbuilder account. We also added the path to java11 on the .zshrc of the mantidbuilder account.

Based on that, we struggled with the ILL specificity: the proxy. We had to modify jenkins-node/mantid-builder-macos/ansible/jenkins-agent.yml:

+ environment:
+   http_proxy: proxy.ill.fr:8888
+   https_proxy: proxy.ill.fr:8888
+   all_proxy: proxy.ill.fr:8888
+   HTTP_PROXY: proxy.ill.fr:8888
+   HTTPS_PROXY: proxy.ill.fr:8888
+   ALL_PROXY: proxy.ill.fr:8888

jenkins-node/mantid-builder-macos/ansible/roles/agent/tasks/check-connection.sh:

-$HOME/jenkins-slave.sh $AGENT_NAME $AGENT_SECRET &
+$HOME/jenkins-slave.sh $AGENT_NAME $AGENT_SECRET proxy.ill.fr 8888 &

jenkins-node/mantid-builder-macos/ansible/roles/agent/tasks/main.yml:

-    job: "$HOME/jenkins-slave.sh {{ agent_name }} {{ agent_secret }}"
+    job: "$HOME/jenkins-slave.sh {{ agent_name }} {{ agent_secret }} proxy.ill.fr 8888"

The check-connection script is failing, as long as the jenkins-slave one, with an error claiming the "provided port is not reachable". Apparently, the proxy parameters are not applied by the agent.jar code, since it tries to reach directly the builds.mantidproject.org website.

MialLewis commented 1 year ago

Thanks Remi, I will forward this and cc you in.

From: Remi Perenon @.> Sent: 23 May 2023 15:02 To: mantidproject/dockerfiles @.> Cc: Lewis, Mial (STFC,RAL,ISIS) @.>; Assign @.> Subject: Re: [mantidproject/dockerfiles] Create Ansible Playbook for Deploying to macOS (PR #67)

Hi, we spent some time with @eurydice76https://github.com/eurydice76 to test this PR on a local machine. This machine is pretty old (OS stuck on Monterrey).

First, to run ansible, we had to set up a SSH key pair between the account running ansible and the mantidbuilder account. It was mandatory and never worked otherwise.

Then, the homebrew configuration was strange (flawed), so the installation of git and java11 through ansible was not working. We had to modify the ownership of many folders on our machine, and install git and java11 manually on the mantidbuilder account. We also added the path to java11 on the .zshrc of the mantidbuilder account.

Based on that, we struggled with the ILL specificity: the proxy. We had to modify jenkins-node/mantid-builder-macos/ansible/jenkins-agent.yml:

jenkins-node/mantid-builder-macos/ansible/roles/agent/tasks/check-connection.sh:

-$HOME/jenkins-slave.sh $AGENT_NAME $AGENT_SECRET &

+$HOME/jenkins-slave.sh $AGENT_NAME $AGENT_SECRET proxy.ill.fr 8888 &

jenkins-node/mantid-builder-macos/ansible/roles/agent/tasks/main.yml:

The check-connection script is failing, as long as the jenkins-slave one, with an error claiming the "provided port is not reachable". Apparently, the proxy parameters are not applied by the agent.jar code, since it tries to reach directly the builds.mantidproject.orghttps://builds.mantidproject.org website.

— Reply to this email directly, view it on GitHubhttps://github.com/mantidproject/dockerfiles/pull/67#issuecomment-1559452674, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWZQ65U4R5L5ZD6RNR65W33XHS7PJANCNFSM6AAAAAAUVTDGQE. You are receiving this because you were assigned.Message ID: @.**@.>>

MialLewis commented 7 months ago

I've used this several times and it works well and has been used to set up both of our M1 macs. Since my last use the following dependencies have been added to our Mac runners and need to be included in the script:

Martyn pointed out that as is node based, we could use bun in place of npm and node and get improved performance, but this is not how it's currently done on the M1s.

EDIT: This is likely why we aren't getting the icon: https://github.com/sindresorhus/create-dmg/issues/42#issuecomment-826788797