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

Shxco apache to nginx upgrade #154

Merged
merged 12 commits into from
Dec 20, 2023
Merged

Shxco apache to nginx upgrade #154

merged 12 commits into from
Dec 20, 2023

Conversation

quadrismegistus
Copy link
Contributor

@quadrismegistus quadrismegistus commented Oct 16, 2023

For #148

also includes a fix for #143 and changes for #169

@quadrismegistus
Copy link
Contributor Author

This error seems to be arising from issues with overwriting the python environment:

TASK [python : Upgrade pip/setuptools] ************************************************************************
fatal: [cdh-test-shxco1.princeton.edu]: FAILED! => changed=false 
  cmd:
  - /srv/www/mep/1.6.0-dev-c9f08c/env/bin/pip3
  - install
  - -U
  - pip
  - setuptools
  msg: |-
    stdout: Requirement already satisfied: pip in /srv/www/mep/1.6.0-dev-c9f08c/env/lib/python3.8/site-packages (23.3)
    Requirement already satisfied: setuptools in /srv/www/mep/1.6.0-dev-c9f08c/env/lib/python3.8/site-packages (57.5.0)
    Collecting setuptools
      Using cached setuptools-68.2.2-py3-none-any.whl.metadata (6.3 kB)
    Using cached setuptools-68.2.2-py3-none-any.whl (807 kB)
    Installing collected packages: setuptools
      Attempting uninstall: setuptools
        Found existing installation: setuptools 57.5.0
        Uninstalling setuptools-57.5.0:
  
    :stderr: ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: 'setup.cpython-38.pyc'
    Check the permissions.

PLAY RECAP ****************************************************************************************************
cdh-test-shxco1.princeton.edu : ok=50   changed=7    unreachable=0    failed=1    skipped=5    rescued=0    ignored=0   
lib-solr-staging4.princeton.edu : ok=12   changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   

Copy link
Contributor

@rlskoeser rlskoeser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. I think one set of variables should be moved/tweaked slightly to share and differentiate qa and prod.

Make sure to remove the commented out apache stuff before merging.

Comment on lines 15 to 19
# set passenger defaults for production; override for other environments
passenger_app_root: "/var/www/{{ app_name }}"
passenger_server_name: "shakespeareandco.princeton.edu"
passenger_startup_file: "{{ app_name }}/wsgi.py"
passenger_python: "{{ passenger_app_root }}/env/bin/python"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be set in the main shxco vars and then qa vars should override the passenger server name with the qa hostname https://test-shakespeareandco.cdh.princeton.edu/

- build_npm
- run_webpack # dependency for collectstatic
- configure_logging # logging directory must exist before running django commands
- django
- solr_collection
- configure_apache
# - configure_apache
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# - configure_apache

Comment on lines 24 to 32
# NOTE: upgrading nodejs with ansible snap fails, even though
# the documentation claims it should refresh when then channel changes.
# Manually run a refresh command to ensure version changes take effect, e.g.:
# sudo snap refresh node --channel=18
# NOTE2: could add a node -v check and only refresh on mismatch

- name: Refresh nodejs to ensure version changes take effect
become: true
ansible.builtin.command: "snap refresh node --channel={{ node_version }}/stable"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kayiwa FYI, we (@quadrismegistus and I) needed to solve the node upgrade problem (#143) and came up with a simpler solution than switching to the princeton ansible role (as previously proposed). Running the refresh command here resolves the problem, and doesn't seem to cause any problems or delay when refresh has been done. The comment above should make it clear why this is here, and if/when ansible actually runs the refresh as it claims to do this stanza can be removed.

@rlskoeser rlskoeser merged commit 5374a74 into main Dec 20, 2023
@rlskoeser rlskoeser deleted the mep-no-apache branch December 20, 2023 21:18
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 this pull request may close these issues.

2 participants