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

Support for setting GALAXY_INSTALL_PREBUILT_CLIENT #207

Closed
hexylena opened this issue Feb 27, 2024 · 4 comments · Fixed by #209
Closed

Support for setting GALAXY_INSTALL_PREBUILT_CLIENT #207

hexylena opened this issue Feb 27, 2024 · 4 comments · Fixed by #209
Assignees

Comments

@hexylena
Copy link
Member

Since we're not using run.sh, we'll need to re-implement it, but it would be really nice to have support for this variable. I don't think there's many (any?) other run.sh variables we really want to make configurable but this is definitely one.

@dometto
Copy link
Contributor

dometto commented Apr 3, 2024

Is this being worked on? If not, I would be happy to open a PR. The ability to support the prebuilt client is crucial for us as we are aiming to do cloud deployments of galaxy, and building is slowing down deployment unacceptably long. Optionally using the prebuilt client in ansible would be a great solution!

In fact, I've modified the client.yml tasks and already got this to work in its most basic form with:

- name: Install prebuilt client via with yarn
  yarn:
    executable: "yarn --network-timeout 300000 --check-files"
    path: "{{ galaxy_server_dir }}"
  environment:
    PATH: "{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
    VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
  when: not __galaxy_from_git.stat.exists or (__galaxy_client_build_version != __galaxy_current_commit_id)

- name: Stage prebuilt client
  command: "yarn run stage"
  args:
    chdir: "{{ galaxy_server_dir }}"
  environment:
    PATH: "{{ galaxy_server_dir }}/client/node_modules/.bin:{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
    VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
  when: "__galaxy_major_version is version('23.0', '>=')"

I noticed that the client_build_hash.txt does not match the expected git commit value, so currently the role executes these steps every time I run my playbook, but I assume this would be fixed as soon as a new release of the prebuilt client is done?

@natefoo
Copy link
Member

natefoo commented Apr 3, 2024

Thanks! A PR would definitely be welcome.

The make-based build process currently updates client_build_hash.txt, so we'd need to do something else in this case. You could as a final step write {{ __galaxy_current_commit_id }} to {{ galaxy_static_dir }}/client_build_hash.txt with a task like:

- name: Write client_build_hash.txt
  copy:
    content: "{{ __galaxy_current_commit_id }}"
    dest: "{{ galaxy_static_dir }}/client_build_hash.txt"
    mode: "0644"

@dometto
Copy link
Contributor

dometto commented Apr 3, 2024

Thanks for the suggestion! Or maybe it makes sense to just skip the entire comparison between commit hashes in case galaxy_use_prebuilt_client (or some such) is set to true? Instead, we could e.g. use the yarn module to manage the client dependency and run yarn run stage only when its state changes.

@natefoo
Copy link
Member

natefoo commented Apr 3, 2024

Yes, that would be even better. To fit with existing naming maybe galaxy_client_use_prebuilt?

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

Successfully merging a pull request may close this issue.

3 participants