Creating a Docker image to easily run and deploy OJS - room to improve?!

Hi all!

I have the task to install OJS 2.x on a server and to make things a bit easier I have built this upon an existing project on GitHub. You can see the code and some instructions here: https://github.com/nuest/docker-pkp-ojs/tree/master/2.x

There also is a related GitHub issue, but I’d like to start the discussion here to see if others would be interested in this (who might not follow the GitHub repo) and to get feedback.

One of the remaining issues where somebody here might be able to help is the following:

Is it possible to pre-fill the values in the installation form based on the values in the config.inc.php file? Maybe there is a setting that I missed? Ideally, I would like to programatically put in some settings in the configuration file so that the adminstrator can simply inspect them in the installation form and enter the remaining required fields.

I did see that OJS 3’s vagrant file uses a POST to create this, but that does not help me, since the user will have to open the URL in the browser. Maybe somebody can shed light on how this works in the Vagrant file?

3 Likes

I have wished for this feature myself.

Hi all,

That might make a good addition to the command-line installation script – an option to have it pull from the configuration file rather than asking for user input.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher Can you point me to documentation about / code of the command-line installation script? It would also help me if I could pass parameters directly to it.

The CLI installer is kicked off by this script:

This ends up calling the methods of InstallTool:

Just to confirm what I read from the code (I am no PHP expert…): This installer is interactive, meaning there is no way to simply pass it all the settings that I have - correct?

Yes, the current installer expects an interactive run.

Would it be interesting for you to have a non-interactive option? Is that something that you might even implement sooner rather than later?

In the case of “yes, but no”, I might give it a try, but with limited experience in PHP it might take quite some time…

Yes, a non-interactive install would a good enhancement, but I doubt it will be an immediate priority, especially for the 2.x line. Most effort is currently going into the 3.x release.

Hi!
Finally found some time to continue here.

@ctgraham - Is a non-interactive option planned for 3.x ?

Hi @nuest,

I’d like to add one, but it’s currently not a high priority. We had one in OJS 2.4.x and my sense is that it was rarely used. Have a look at the Vagrant image and the work-around that was used there, which is to POST directly to the installation form:
https://github.com/pkp/vagrant/blob/ojs-master/scripts/ojs.sh#L26

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Wait, there’s a non-interactive CLI installer for OJS 2.4.x? How do you access it?

Hi @ctgraham,

Sorry, I missed the non-interactive element – the command-line installer is interactive too.

Regards,
Alec Smecher
Public Knowledge Project Team

@nuest, did you finish this?

Here you have similar experiences:

Instead of installing, why not loading a preinstalled DB dump?
This is what I do with “mojo” and saves me a lot of time.

@marc Thanks for reviving this thread. I did not continue work on this, so thanks for the two links to more recent works.

Regarding the database dump for configuration: I see the important disadvantage that this would be non-text, i.e. binary. Can you confirm that?

Having a plain text-based configuration is important for being able to script the configuration, e.g. replace some placeholder with tools like Puppet or Ansible.

@asmecher Does OJS 3.x have a non-interactive installer?

Hi @nuest,

Does OJS 3.x have a non-interactive installer?

Not at the moment, but the example above shows a not-too-messy work-around permitting a script to execute the installer.

Regards,
Alec Smecher
Public Knowledge Project Team

I have been setting my new sites from a mysqldump during the last 5 years and I didn’t see any trouble.

Googling looks like blobs could be a little tricky, but you nothing to worry about if you use the “–hex-blob” parameter:

I’m starting to think in OJS 3 migration so I’m also looking for a “mojo” improvement or a replacement…

Make sense to use docker to keep multiple OJS sites in a production server?

Hi all,

Not necessarily advocating the use of database dumps – but there’s no binary content stored in OJS’s database, so it would just be a textual .sql.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher Still being an OJS newbie, can you point me to how such an SQL file could look like? Is there an initial SQL file in the source code?

Hi @nuest,

We don’t have a current one in the codebase, but here’s an old one, just to give you an example of what it might look like.

Regards,
Alec Smecher
Public Knowledge Project Team