Giter Site home page Giter Site logo

Comments (4)

natefoo avatar natefoo commented on June 30, 2024 1

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"

from ansible-galaxy.

natefoo avatar natefoo commented on June 30, 2024 1

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

from ansible-galaxy.

dometto avatar dometto commented on June 30, 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?

from ansible-galaxy.

dometto avatar dometto commented on June 30, 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.

from ansible-galaxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.