Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Synchronize dev and prod Fedora environmental variables #64

Open
ksclarke opened this issue Oct 24, 2018 · 3 comments
Open

Synchronize dev and prod Fedora environmental variables #64

ksclarke opened this issue Oct 24, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@ksclarke
Copy link
Member

ksclarke commented Oct 24, 2018

Having a separate 'prod' and 'dev' fedora environment on the dev box causes problems. On that machine, we want there to be just 'test' and another Fedora node/context/environment. In fact, on our servers it's also fine that there is only one Fedora node/context/environment (the production one).

We need to make some changes to the Ansible roles to synchronize.

Add to templates/dotenv_config.j2:

FEDORA_BASE_PATH={{ fedora_base_path }}

Add to defaults/main.yml:

fedora_base_path: "{{ project_name }}"

This will make the Fedora node/context/environment be 'californica' instead of 'prod'.

We also need to add to README.md documentation about setting the FEDORA_BASE_PATH variable. It exists in the californica code base already but is new to our Ansible roles.

@ksclarke ksclarke added the bug Something isn't working label Oct 24, 2018
@mark-dce
Copy link

mark-dce commented Nov 6, 2018

@ksclarke can you be more specific about "causes problems" in your first sentence? I don't quite understand the underlying problem here, so I'm not sure how much to interject, but DCE has moved away from naming services by project-name because it sometimes makes maintenance and documentation more complicated.

@mark-dce mark-dce removed the backlog label Nov 6, 2018
@ksclarke
Copy link
Member Author

ksclarke commented Nov 6, 2018

For the dev box, the production and the development configs are the same, except currently with Fedora (where the /prod and /dev contexts still persist and cause problems when trying to do things like edit a record in the UI -- due to things being ingested as "dev" but served up via "prod"). We could just set both to /prod in the dev box Ansible build and that'd be fine (would resolve the immediate issue).

I just suggested the project name because on servers and the dev box we only have one context. Using the project name is a way to have a single meaningful Fedora context that's not distinguished as "prod" or "dev", which really are the names of the environment and more useful if you had both environments on a single machine (not the case for our servers or dev box).

I think that maintenance isn't an issue because we rely on Ansible to do our builds. I could see if things weren't automated how it might cause issues. I see the argument that documentation across many different Samvera projects is more complicated. We'll only have one Samvera though, unlike you all who have lots of clients.

@mark-dce
Copy link

mark-dce commented Nov 6, 2018

In reverse order - agreed, it's probably less of an issue to use the project name since you'll have fewer project names to work with, but you will need to remember to substitute project-name for dev when following any community documentation - probably not a biggie.

I'm confused why the application in the dev environment is serving things up under /prod fedora - I'm not sure you want to run your development workflow against a web server configured for production even on a VM. Rails makes lots of tuning to the "development" environment to prioritize a single user making real-time changes and the "production" environment to prioritize performant multi-user access with longer startup time. e.g. compare config.cache_classes and config.consider_all_requests_local = true in https://github.com/UCLALibrary/californica/blob/master/config/environments/development.rb and https://github.com/UCLALibrary/californica/blob/master/config/environments/production.rb

So, it sounds like somewhere something is assuming "RAILS_ENV=production"??? I think you really want your development work to be happening in an environment where "RAILS_ENV=development" on the VM. Does that make sense and does it help in this context any?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants