FarCry Workbench Project

Ambition

We want to build a distributable development environment for FarCry with a number of core features:

  • works across Windows, Linux and OSX development workstations
  • only requires a few instructions from a README to get going
  • doubles as a deployment pipeline for updating your production code

It’s part of our goal to have a maximum 4 hour window to project productivity for any employee (no matter how new).

Stack

While FarCry supports a myriad of deployment configurations, we’re focused on a stack that resembles our ideal production environment. More variants will come in time.

Base stack includes:

  • Latest Ubuntu LTS (currently Trusty64)
  • Tomcat 8
  • NGINX
  • Lucee 4.5
  • mySQL 5.5

Deployment

Our deployment scripts all assume you have code stored in GIT repos, and that they only require a single ssh key (or anon) to get access to them.

The FarCry project format has an ./install folder that can be filled with sample data, and a deploy.txt describing project dependencies. We want to leverage these options to automate the installation of projects.

Progress

Daemonites have been involved in a lot of devops projects over the last couple of years. We’d hoped to bring you an instant “FarCry In A Box” style of development environment for a while, but its been hard to make our scripting environments generic enough for public consumption.

@blair and @modius spent the last week cherry picking the best options from our various deployments. We trying to build a generic set of ansible-roles to drive both vagrant and ec2 deployments (and potentially any sort of deployment). We think we may have cracked it.

If you would like to help us get a universal FarCry Workbench up and running, please take a look at the prototype at http://github.com/modius/farcry-env-chelsea and give us your feedback.


This is a companion discussion topic for the original entry at http://blog.farcrycore.org/blog/farcry-workbench

If I can get a confirmation as a reply from a few different folks that this comes up with a running environment, I’d be grateful :carousel_horse: Just let me know your developer environment; for example, works great on OSX (Yosemite).

Vagrant Install

This only needs to be the once per workstation. If you already have a working Vagrant environment you can skip this part (except the vagrant-hostmanager plugin).

Setting Up Workbench

Requires an existing installation of the standard Daemonite Vagrant Workbench, then just fire up a terminal:

git clone https://github.com/modius/farcry-env-chelsea.git
cd farcry-env-chelsea
git submodule update --init
vagrant up

note: depending on your environment you may need to put in your password for the vagrant-hostmanager plugin to write to your hosts file

Wait… it takes time

It can take a little while to come up for the very first time, especially if your internet connection is average. Don’t do this from a mobile.

  • got to get ubuntu/trusty64 image if its your first time
  • there’s a few downloads (nginx, mysql, lucee installer) to get through
  • a few github pulls; though these should be quick
  • double check the terminal that its not waiting on your password to write out the hosts file!

Once you are through the downloads, it can take about 20 minutes to provision for the very first time. Once its provisioned its as fast as starting up a virtual – so pretty quick.

I’ll give this a try today. Thanks guys.

In the meantime, care to comment on why you guys use Ansible for provisioning? Having only used Chef and manually written shell scripts, I’m curious to hear your opinion of Ansible and what it offers over Chef.

1 Like

should be

git clone https://github.com/modius/farcry-env-chelsea.git

1 Like

Host: Mac OS X Yosemite, Vagrant 1.7.2, VirtualBox 4.3.22

First boot:

Lots of COAPI conflicts:

Was able to log into the webtop, as you see above. The “logout” link in the menu did not respect the :8080 port I was using to browse the site.

Deploying the coapi changes and restarting FarCry did not fix the “[TYPENAME] does not exist” error. I’m unable to browse the site.

“vagrant” is NOT the password for the Lucee server admin, nor the web admin either. Not sure what the password is, so I was unable to login.

There are also a few typos/errors in the README that I am going to send a pull request to fix.

Ah… that’s missing refObjects entries which is the default state post install – we probably need to add an ?updateall=projectkey to the initial load to fix that.

Easiest to use http://chelsea.local – the setting for the domain has to be changed in both ./group_vars/vagrant

domains: [ "chelsea.local", "192.198.3.22" ]

And Vagrantfile

# WEB_HOSTNAME must match ./group_vars/vagrant domains setting
WEB_HOSTNAME = "chelsea.local"

Yeah using chelsea.local works fine. Just pointed out the :8080 issue because the README specifically mentions it.

http://chelsea.local/?updateall=farcry seems to have fixed the browsing issue.

Search is broken http://chelsea.local/search?q=chelsea

UPDATE: Fixed

1 Like

Both web and server admins (http://chelsea.local/lucee/admin/server.cfm) appear to be defaulting to farcry.

The passwords have to be set as Lucee hashes – these can only be generated by setting a password and copying it out of the Lucee server config.

./group_vars/webservers

  cfml_server_password_hash: "bd1f869de33f5424e865f5e3a8e945a436f284df6b7bef1a5be79df1e8c186d0"
  cfml_website_password_hash: "bd1f869de33f5424e865f5e3a8e945a436f284df6b7bef1a5be79df1e8c186d0"

What do we think the default, non-secure passwords for the workbench should be?

farcry is what we typically use for non-secured defaults for FarCry webapp, but we also default to vagrant or nothing for other infrastructure. Perhaps they should all be the same in this instance.

Uploading images to the image library seems broken as well. The UI appears to upload the image fine, but it 404s

I do see the images I uploaded in the www/images/dmImage/* directories though. So its uploading, something else is breaking the link. Maybe the spaces in the filename?

Yeah, looks like the image URL is rendered as:

http://chelsea.local/images/dmImage/ThumbnailImage/Landscape+-+Fantasy.jpg

which doesn’t work. If I replace the “+” with a space or %20 it works fine.

Check your nginx config and the rewrite rules. Make sure that “+” is listed in the rewrite rule. I know the default “suggested” Friendly URL rewrite rule is missing the “+” character

I think either farcry or vagrant is fine. farcry has been the default for FarCry installations for a while so FC devs will be used to that. Anyone who has used Vagrant will be used to having “vagrant” be the password for everything.

So, I don’t think it matters much which you choose, but I think it should be the same for all (FC webtop, Lucee admins, mysql root pw, or create a vagrant/vagrant, farcry/farcry user in mysql too, etc). That way we don’t have to guess. “Oh, I use ‘farcry’ here, but here its ‘vagrant’”.

Yeah, the NGINX FU regex is much simpler than normal:

./provisioning/website/templates/nginx.conf

location @farcry {
        rewrite ^([^\.]*)$  /index.cfm?furl=$1 last;
    }

I’d prefer to get rid of spaces from any uploaded assets in any event… but maybe the REGEX needs to be a little more sophisticated.

Agreed. I’d love it if core renamed the files so they did not contain spaces. I get content editors uploading them all the time, and while it doesn’t usually cause too many issues, it sometimes does.

COAPI conflicts are all optional database indexation suggestions – i don’t think we deploy these as part of an ?updateall=projectkey… perhaps we should be.

OK, I didn’t look specifically, thought it might have been related to the error I saw from the front end. I think a clean database install after provisioning, including indexes would be good, but you’re right, they’re optional.

One other suggestion. If you add a Gemfile with a :plugins block, Vagrant will install the required plugins for you. So you could add:

Gemfile

source "https://rubygems.org"

group :plugins do
  gem "vagrant-hostmanager"
end

Bundler Support: https://www.vagrantup.com/blog/vagrant-1-5-plugin-improvements.html#toc_1

1 Like

Added a Gemfile – with any luck that works.

(are we sure this works and its not just for Vagrant plugin development? Will have to keep an eye out for this causing grief)

Fandango Workbench

If you are a sucker for punishment, you might want to try an alternative workbench using Fandango project. Ideally I want to have a super light-weight repo that just configs the environment and is easy to copy and set up so that anyone can have their own project workbench.

git clone https://github.com/modius/farcry-env-fandango.git
cd farcry-env-fandango
git submodule update --init
vagrant up

Note requires an existing installation of the standard Daemonite Vagrant Workbench.