openrightsgroup / cmp-issues

Centralised issue-tracking for the Blocked backend
2 stars 0 forks source link

Drop vagrant and migrate to Docker #153

Open nllz opened 8 years ago

dantheta commented 8 years ago

There's an updated ansible playbook here: https://github.com/openrightsgroup/Blocking-Middleware/tree/feature/unicode_urls/ansible

This should provide information on system components, versions and configuration

damianmoore commented 8 years ago

Great, I'm looking at this.

damianmoore commented 8 years ago

I haven't actually been able to find the code that generates the Vagrant image http://dretzq.org.uk/vagrant/ORGapi2.box

I'm looking for where the PHP dependencies get installed so have been searching for things like pecl, yum, apt.

dantheta commented 8 years ago

The vagrant image was based on CentOS 5, and is probably safe to disregard after so long. The list of PHP packages is in the api role of the ansible playbook:

https://github.com/openrightsgroup/Blocking-Middleware/blob/feature/unicode_urls/ansible/roles/api/tasks/debian.yml

dantheta commented 8 years ago

Hiya - How are you getting on? Is there anything I can help with?

damianmoore commented 8 years ago

Hi Dan, I've definitely got a good chunk of the way there. I have a branch you can compare here: https://github.com/openrightsgroup/Blocking-Middleware/compare/master...damianmoore:feature/docker

I have Apache, PHP, MySQL running and can access some endpoints. I discovered the /example-client/ endpoint and have had a play around, trying to post various forms. I'm alternating between the Docker version and the Vagrant version to compare but I'm not sure if the Vagrant one is working properly either.

Are there any API endpoints that should work yet, given I have not got to the stage of running RabbitMQ yet? I'm getting some errors like 'UserLookupError' at the moment so I guess I need to create some. It would be good to have a little script to test whether the environment is operating. Should client_tests be runnable?

I'm kind of lacking the experience of having set up the system before. I confess, I've not read a lot of the documentation yet, so I'm sure I could find some next steps myself.

dantheta commented 8 years ago

That's looking really great - many thanks!

There's an SQL file at mysql/example-init.sql that creates a sample user and ISP record. Running this against the MySQL database (once the schema has been loaded) will give you a user record to match the example-client's credentials.example.php. You can rename this file to credentials.php to get the example client to run. From there, you should be able to use the example forms to submit queries.

The client_tests are very old and almost certainly don't work. I'd meant to update them to use phpunit ...

There's an api config file as well, which goes into api/1.2/libs/config.php (there's an example file alongside). This takes the database and rabbit credentials.

Once the rabbit container is linked in, we should be able to:

The Vagrant-provision.sh script contains these steps, although that was written for an environment with all the components pre-installed. Might still prove to be a reasonable guide though.

Many thanks once again!

damianmoore commented 8 years ago

Thanks for all that info - I'm sure it will help me along. I probably won't get much time to look into this for the next 2 weeks, due to other commitments unfortunately, but I won't forget about this :)