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

Update to stable/1.7.x #52

Merged
merged 6 commits into from
Feb 15, 2018
Merged

Update to stable/1.7.x #52

merged 6 commits into from
Feb 15, 2018

Conversation

scollazo
Copy link
Member

@scollazo scollazo commented Jan 31, 2018

This pr brings updates needed for stable/1.7.x deployment

@scollazo scollazo added the Status: refining The issue needs additional details to ensure that requirements are clear. Waffle label. label Jan 31, 2018
scollazo added a commit to artefactual-labs/ansible-archivematica-src that referenced this pull request Jan 31, 2018
After artefactual/deploy-pub#52 is merged, we won't be using a
a shared folder for code deployment in virtualbox.
@scollazo
Copy link
Member Author

scollazo commented Jan 31, 2018

Related to #51

@scollazo
Copy link
Member Author

I think that changing the path to the archivematica clone in order to avoid the virtualbox shared folder, will fix #22 , and help with windows support ( #40)

@hakamine
Copy link
Member

I think the main reason to put the archivematica code in a synced folder was to allow developers to easily modify the code from the host (which is a big plus for development). If the code is now deployed to /opt/archivematica and this folder is not synced this feature will be lost.

@scollazo
Copy link
Member Author

scollazo commented Feb 6, 2018

The problem is that the npm package have problems to install/build. I think this happens because they need a lot of different files, and the vbox driver is not able to handle that in a timely fashion, and that affects all users, developers or not.

We should look for other ways to share the source between the host and the vm

Copy link
Member

@sevein sevein left a comment

Choose a reason for hiding this comment

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

I'd suggest to address the changes around synced folders separately. This would mean giving up on deploy-pub as a development workflow - is that what we want? Should we file an issue and consult the team/community beforehand? Perhaps we should have a playbooks/archivematica-development playbook?

This PR could remain as the changeset suggested to update the branch requirements of the roles and the changes around the indexless feature.

@jrwdunham
Copy link
Contributor

Should the archivematica_src_search_enabled var be in the vars-singlenode-x.yml files with a default "yes" value? Also, as with the ansible role PR, should we document this new variable and the indexless option in the README here too?

@jhsimpson
Copy link
Member

This might not be a relevant comment, but does part of the problem come from the need to build the javascript apps with node on the server Archivematica is being deployed to? In the past, the appraisal tab and transfer browser components were built manually using webpack, and so there were fewer build dependencies required during deployment.

If the node apps where built and stored in an registry or artifact repository somewhere, would that make the deploy faster and work with fewer dependencies?

@sevein
Copy link
Member

sevein commented Feb 6, 2018

How much faster do you want it to be? I can manually 1) clone the repo, 2) build appraisal-tab and 3) build transfer-browser in about a minute. I've uploaded a little asciinema so you have an idea how fast this stuff got in the last year: https://asciinema.org/a/ibpqExMCCJiQKPwBXWR5kMMJD. Building with yarn seems a tiny bit faster but it's almost unnoticeable. And if we merged transfer-browser and appraisal-tab as a single front-end project then we would cut the build time in half.

For some perspective, lxml alone takes 1 minute and 20 seconds to build. We build it four times (MCPServer/MCPClient/Dashboard/StorageService).

The problem with the Dashboard front-end build that Santi is trying to fix is only reproducible when you're using VirtualBox + vboxsf shared folders. We could arrange things in this repo so vboxsf is only used by a new playbooks/archivematica-dev environment where we also ask the developer to run npm install manually from the host.

For deployments, deb/rpm packages and our Docker image already bundles the front-end prebuilts. I think that it'd be ok if we continue letting Ansible build all the things from scratch, it makes things simpler for us.

@sevein
Copy link
Member

sevein commented Feb 6, 2018

Does this work on the vagrant environment, using a shared folder for archivematica?

No. But I think that this could be considered a minor issue iff we used vboxsf in development environments (e.g. playbooks/archivematica-dev?). We would also have to tell developers to avoid running npm install inside the virtual machine but run it from the host instead.

@scollazo
Copy link
Member Author

scollazo commented Feb 6, 2018

Should the archivematica_src_search_enabled var be in the vars-singlenode-x.yml files with a default "yes" value? Also, as with the ansible role PR, should we document this new variable and the indexless option in the README here too?

The current docs point to the defaults/main.yml, not sure why this case requires to be added in a explicit way

@scollazo
Copy link
Member Author

scollazo commented Feb 6, 2018

@sevein we have archivematica_src_environment_type that defaults to production, but is overrided in the vagrantfile with development

I think we should use the default value when building from vagrant, and set to "development" when needed. When this "development" mode is enabled, we won't build npm dependencies.

What do you think?

@sevein
Copy link
Member

sevein commented Feb 6, 2018

Sounds like a good plan.

@@ -31,7 +31,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end

# Make the project root available to the guest VM
config.vm.synced_folder '.', '/vagrant'
config.vm.synced_folder '.', '/home/vagrant-sync'
Copy link
Member

Choose a reason for hiding this comment

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

IIRC /vagrant is a default synced folder configured by Vagrant and the original L34 wasn't really needed. I think that what this means is that with your change you would have a new /home/vagrant-sync but /vagrant would still be configured automatically. I haven't confirmed it but I have a strong feeling that this is the case.

If you wanted to disable /vagrant I think that you'd need to add the additional line:

config.vm.synced_folder ".", "/vagrant", disabled: true

In any case, I'd still recommend to submit this as a separate issue/pull-request.

@scollazo
Copy link
Member Author

scollazo commented Feb 8, 2018

Created artefactual-labs/ansible-archivematica-src#173 to circunvent the issue with vagrant and shared folders

@jrwdunham
Copy link
Contributor

Should the archivematica_src_search_enabled var be in the vars-singlenode-x.yml files with a default "yes" value? Also, as with the ansible role PR, should we document this new variable and the indexless option in the README here too?

The current docs point to the defaults/main.yml, not sure why this case requires to be added in a explicit way

But you're talking about https://github.com/artefactual-labs/ansible-archivematica-src/tree/qa/1.7.x, right? I mean, in this repo and this PR we only mention the archivematica_src_search_enabled var twice, once in playbooks/archivematica/singlenode.yml and the other time in playbooks/archivematica-xenial/singlenode.yml.

It seems to me, that in order to make it easy for an end user of this repo to deploy AM without indexing, we should have archivematica_src_search_enabled: "no" in the following:

  • playbooks/archivematica-xenial/vars-singlenode-1.7.yml
  • playbooks/archivematica/vars-singlenode-1.7.yml

@jrwdunham jrwdunham added Columbia University Library CUL: phase 1 In Progress and removed Status: refining The issue needs additional details to ensure that requirements are clear. Waffle label. labels Feb 11, 2018
Copy link
Member

@sevein sevein left a comment

Choose a reason for hiding this comment

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

Can you update the description of the PR? I think that the current description is not describing all the changes that you're making. I just want to make sure that when someone lands into this PR it's easier to see what changes are happening and why.

Also, the development workflow changes considerably, i.e.:

  1. The developer needs to change the environment type variable (archivematica_src_environment_type) to development,
  2. The developer needs to assign the /vagrant/src/ value to archivematica_src_dir,
  3. The developer needs to run npm install manually from the host.

Should this be added to the README?

- name: "Set SELinux to Permissive"
command: "setenforce Permissive"
become: "yes"
- name: "Selinux boolean 1"
Copy link
Member

Choose a reason for hiding this comment

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

Could this be more descriptive?
e.g. SELinux: allow HTTPD scripts and modules to connect to the network.

Same with the others.

- name: "Selinux seport"
become: "yes"
seport:
ports: 8000,8001
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to quote this so it's consistent with our style of writing YAML files? It's definitely a string.

state: "present"
when: ansible_selinux.status == "enabled"

- name: "Enable epel repository"
Copy link
Member

Choose a reason for hiding this comment

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

s/epel/EPEL

Copy link
Member

@sevein sevein left a comment

Choose a reason for hiding this comment

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

What do you think about these notes for the README in regards to the development workflow? https://gist.github.com/sevein/74f26cf6638ff19276e2808c152faf71

@scollazo
Copy link
Member Author

I'm testing a fix for the root cause, adding config.vm.synced_folder '.', '/vagrant',mount_options: ["uid=333", "gid=333"] to the vagrant file configuration may be the key to the npm problem.

If it works, I'll push
https://github.com/artefactual/deploy-pub/compare/dev/update-to-1.7-take3 to this pr

@scollazo
Copy link
Member Author

Tested with trusty, and npm works.

Also, a pull request removing the workaround in the archivematica ansible role that should be merged for this to work, has been created at artefactual-labs/ansible-archivematica-src#174

@@ -32,7 +32,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end

# Make the project root available to the guest VM
config.vm.synced_folder '.', '/vagrant'
config.vm.synced_folder '.', '/vagrant',mount_options: ["uid=333", "gid=333"]
Copy link
Member

Choose a reason for hiding this comment

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

Whitespace after the comma?

Copy link
Member

@sevein sevein left a comment

Choose a reason for hiding this comment

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

The description of the PR is outdated.

My comments have not been addressed yet.

@qubot qubot force-pushed the dev/update-to-1.7 branch 2 times, most recently from 98842f7 to 9f54fb9 Compare February 15, 2018 17:52
@scollazo
Copy link
Member Author

@sevein your feedback has been addresed. Regarding your gist, I would prefer to merge this "as is", and make the doc update changes as part of a fix to #53

archivematica_src_am_multi_venvs: "true"
archivematica_src_dir: "/opt/archivematica"
archivematica_src_search_enabled: "yes"
# elasticsearch role
Copy link
Member

Choose a reason for hiding this comment

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

Cosmetic change: missing blank line before L13.

@@ -32,7 +32,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end

# Make the project root available to the guest VM
config.vm.synced_folder '.', '/vagrant'
config.vm.synced_folder '.', '/vagrant',mount_options: ["uid=333","gid=333"]
Copy link
Member

Choose a reason for hiding this comment

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

Whitespace after comma.

Copy link
Member

Choose a reason for hiding this comment

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

Cosmetic: config.vm.synced_folder '.', '/vagrant', mount_options: ["uid=333", "gid=333"]

- name: "Set SELinux to Permissive"
command: "setenforce Permissive"
become: "yes"
- name: "SELinux: Allow nginx connections to gunicorn"
Copy link
Member

Choose a reason for hiding this comment

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

s/gunicorn/Gunicorn


- name: "Enable epel repository"
yum:
- name: "SELinux: Allow nginx to connect to mysql "
Copy link
Member

Choose a reason for hiding this comment

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

  • s/mysql/MySQL
  • whitespace before "

@@ -31,7 +31,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end

# Make the project root available to the guest VM
config.vm.synced_folder '.', '/vagrant'
config.vm.synced_folder '.', '/vagrant',mount_options: ["uid=333","gid=333"]
Copy link
Member

Choose a reason for hiding this comment

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

Missing whitespace after comma.

@qubot qubot force-pushed the dev/update-to-1.7 branch 4 times, most recently from ac3a55e to eb77dab Compare February 15, 2018 18:31
@qubot qubot merged commit 86d70f4 into master Feb 15, 2018
@jrwdunham
Copy link
Contributor

jrwdunham commented Feb 15, 2018

@sevein I like your proposed additions to the README. I don't want to have to re-remember these things if I have to create a new ansible/vagrant dev deploy again some day.

Oops, I didn't realize this had already been merged. Nevermind.

@sevein
Copy link
Member

sevein commented Feb 15, 2018

@sevein I like your proposed additions to the README. I don't want to have to re-remember these things if I have to create a new ansible/vagrant dev deploy again some day.

I'll submit a PR soon!

@qubot qubot deleted the dev/update-to-1.7 branch May 4, 2018 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants