-
Notifications
You must be signed in to change notification settings - Fork 53
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
Crayfish Ansible role #9
Conversation
|
|
Looks like there's a permissions issue that's stopping the whole show. Requests to Hypercube are giving me this in apache's error log:
|
@ajs6f Further inspection show that |
name: "{{item}}" | ||
state: present | ||
with_items: | ||
- tesseract-ocr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to add imagemagick to this list for Houdini. @jonathangreen Now that we're using grok, is there any need to use Lyrasis's PPA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathangreen bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. missed this one in the flood of islandora release tickets yesterday.
Houdini is just a wrapper on imagemagick. We added grok to Cantaloupe. If we want Houdini to be able to work with grok or kdu, we'll have to do some work on it. That said there is certainly an argument that doing that could be beneficial, or that we should just totally dump Houdini and just use cantaloupe instead... but I think thats another ticket.
That was a long winded way of saying we need imagemagick, and if we want it compiled with the JP2 extensions, installing it from the Lyrasis PPA is probably the thing to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathangreen You know me. I'm all about dumping stuff if we don't need to maintain it. I need to check out cantaloupe a little more and see how to replicate Houdini's convert functionality. If we can do that, I say we make a separate ticket and axe it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dannylamb I guess the downside would be that cantaloupe won't fit into the API-X model, but it is a image transformation service that we don't have to maintain...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, the landing here is that I need to get Imagemagick from Lyrasis, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I have a few general thoughts on this role. As is it works, and I think that is good, so I don't want to stop it from being merged. Just thoughts and nits for future improvements that we could break out into a separate ticket if we don't want to handle them here:
- include: install-base.yml
tags:
- crayfish
- crayfish-install-base
- include: install-houdini.yml
tags:
- crayfish
- crayfish-install-houdini
when: crayfish_install_houdini
- include: install-gemini.yml
tags:
- crayfish
- crayfish-install-gemini
when: crayfish_install_gemini
|
Just leaving a breadcrumb: per IRC discussion (man, we got to get an IRC logger that leaves anchors in the HTML) I am going to add some commits at the top of next week to meet @jonathangreen 's excellent advice. |
…icate when config files are Ansible-managed
Okay, I've worked through many of @jonathangreen's comments. But I'm hesitant about the idea of breaking up the tasks into many tasks, simply because the codebase is still unitary. I can't, for example, install the code of Houdini without installing the code of all the other components as well. Do we want to break those guys apart? Of them, I understand Gemini to be the only one that is absolutely required. If we want to break them apart, I'm inclined to merge this and then do that, since that will be a bunch of other work. |
…JP2) and Gemini template config
executable: {{ houdini_executable_config.executable }} | ||
formats: | ||
valid: | ||
{% for type in houdini_executable_config.formats.valid %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the template is expanded it messes up the whitespace here, which makes the YAML fail. Its because of the whitespace before the jinja2 for loop. You can use whitespace control operators in the loop to fix it, or you can just remove the whitespace like so:
houdini:
# path to the convert executable
executable: {{ houdini_executable_config.executable }}
formats:
valid:
{% for type in houdini_executable_config.formats.valid %}
- {{ type }}
{% endfor %}
default: {{ houdini_executable_config.formats.default }}
group: www-data | ||
mode: "u+rwx,g+r,o-rwx" | ||
|
||
- name: Create Gemini log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think you need to do this, as long as the permissions are okay on the directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that was left over from some tinkering.
|
||
- name: Create Gemini db | ||
mysql_db: | ||
name: gemini |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see this use the name form the variables, so you can change the DB name if you want to.
- name: Create Gemini db
mysql_db:
name: "{{ gemini_db_options.dbname }}"
state: present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, that will also have to go into the SQL file.
@@ -0,0 +1,5 @@ | |||
CREATE TABLE IF NOT EXISTS gemini.Gemini ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see this use the variable for the db name as well, also based on the discussion above about idempotency it probably doesn't need the IF NOT EXISTS (although it doesn't hurt to have it there)
CREATE TABLE {{ gemini_db_options.dbname }}.Gemini (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
drupal VARCHAR(2048) NOT NULL UNIQUE,
fedora VARCHAR(2048) NOT NULL UNIQUE
) ENGINE=InnoDB;
@@ -0,0 +1,73 @@ | |||
crayfish_user: www-data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we are in a global namespace, all the variables in this role should be prefixed with the name of the role.
crayfish_syn_token, etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you include the service-specific ones here? It seems more clear to leave them alone if we expect to break them out into independent roles...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its definitely best practice to have them all namespaces to the role, so there are no conflicts in the global namespace. I'd like to see them all prefixed with the role name.
dest: "/tmp/gemini.sql" | ||
|
||
- name: Install Gemini db schema | ||
mysql_db: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is idempotent, because it has the IF NOT EXISTS
in the sql. However, its idiomatic in ansible to keep ansible from reporting changed
on idempotent tasks, so if you are running a bunch of tasks, its easy to see what changed. If you run this task twice, it will always report changed right now.
I think I would rewrite this section this way to keep it from reporting changed:
- name: Create Gemini db
mysql_db:
name: "{{ gemini_db_options.dbname }}"
state: present
register: gemini_db_exists
- name: Grab Gemini db schema
template:
src: "gemini.sql"
dest: "/tmp/gemini.sql"
when: gemini_db_exists.changed
- name: Install Gemini db schema
mysql_db:
state: import
name: all
target: "/tmp/gemini.sql"
when: gemini_db_exists.changed
That way we will only update the schema when the table is first created, and ansible won't report that the tasks have changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't know about something.changed
. Is that a universal thing in Ansible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup! its super handy for things like this sometimes.
hypercube_executable: tesseract | ||
|
||
# Milliner default config | ||
milliner_log_file: /var/log/islandora/gemini.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like wrong log path, probably should be:
milliner_log_file: /var/log/islandora/milliner.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more I just noticed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, fixing.
@jonathangreen I think this is ready for more review. I left |
- name: Create Gemini db | ||
mysql_db: | ||
name: "{{ gemini_db_options.dbname }}" | ||
state: present |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. That's what creates the ability to check changed after this step, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple missed variables.
|
||
- name: Create Gemini db | ||
mysql_db: | ||
name: "{{ gemini_db_options.dbname }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs prefix
@@ -0,0 +1,5 @@ | |||
CREATE TABLE IF NOT EXISTS {{ gemini_db_options.dbname }}.Gemini ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs prefix
Nice catch, fixed! |
Islandora/documentation#691