All RPGs and Storygames by Tod Foley are now available at DrivethruRPG and RPGnow. Bring these games to your table!
I recently worked with the Mass.gov team to transition its development environment from Vagrant to Docker. We went with “vanilla Docker,” as opposed to one of the fine tools like DDev, Drupal VM, Docker4Drupal, etc. We are thankful to those teams for educating and showing us how to do Docker right. A big benefit of vanilla Docker is that skills learned there are generally applicable to any stack, not just LAMP+Drupal. We are super happy with how this environment turned out. We are especially proud of our MySQL Content Sync image — read on for details!Pretty docks at Boston Harbor. Photo credit.Docker compose
The heart of our environment is the docker-compose.yml. Here it is, then read on for a discussion about it.https://medium.com/media/fbc867b921322353081ee532b7d55cf0/href
Developers use .env files to customize aspects of their containers (e.g. VOLUME_FLAGS, PRIVATE_KEY, etc.). This built-in feature of Docker is very convenient. See our .env.example file:https://medium.com/media/ab87671a5208a5fcb1a974d604e0ea3b/hrefMySQL content sync image
The most innovative part of our stack is the mysql container. The Mass.gov Drupal database is gigantic. We have tens of thousands of nodes and 500,000 revisions, each with an unholy number of paragraphs, reference fields, etc. Developers used to drush sql:sync the database from Prod as needed. The transfer and import took many minutes, and had some security risk in the event that sanitization failed on the developer’s machine. The question soon became, “how can we distribute a mysql database that’s already imported and sanitized?” It turns out that Docker is a great way to do just this.
Today, our mysql container builds on CircleCI every night. The build fetches, imports, and sanitizes our Prod database. Next, the build does:https://medium.com/media/780e82c13c0ac1bdf181f4750cd8f36c/href
That is, we commit and push the refreshed image to a private repository on Docker Cloud. Our mysql image is 9GB uncompressed but thanks to Docker, it compresses to 1GB. This image is really convenient to use. Developers fetch a newer image with docker-compose pull mysql. Developers can work on a PR and then when switching to a new PR, do a simple ahoy up && ahoy down. This quickly restores the local Drupal database to a pristine state.
In order for this to work, you have to store MySQL data *inside* the container, instead of using a Docker Volume. Here is the Dockerfile for the mysql image.https://medium.com/media/eaa473e8cf2173bc84d489061a986a77/hrefDrupal image
Our Drupal container is open source — you can see exactly how it’s built. We start from the official PHP image, then add PHP extensions, Apache config, etc.
An interesting innovation in this container is the use of Docker Secrets in order to safely share an SSH key from host to the container. See this answer and mass_id_rsa in the docker-compose.yml above. Also note the two files below which are mounted into the container:https://medium.com/media/4408d6b3b75b87ae3221a60d7a0d656a/hrefhttps://medium.com/media/3d3504fc38cc71e2deaec58802ee9927/hrefTraefik
Traefik is a “cloud edge router” that integrates really well with docker-compose. Just add one or two labels to a service and its web site is served through Traefik. We use Traefik to provide nice local URLs for each of our services (www.mass.local, portainer.mass.local, mailhog.mass.local, …). Without Traefik, all these services would usually live at the same URL with differing ports.
In the future, we hope to upgrade our local sites to SSL. Traefik makes this easy as it can terminate SSL. No web server fiddling required.Ahoy aliases
Our repository features a .ahoy.yml file that defines helpful aliases (see below). In order to use these aliases, developers download Ahoy to their host machine. This helps us match one of the main attractions of tools like DDev/Lando — their brief and useful CLI commands. Ahoy is a convenience feature and developers who prefer to use docker-compose (or their own bash aliases) are free to do so.https://medium.com/media/bb5cd5f672948ca0ca0f0f053aeea03f/hrefBells and whistles
Our development environment comes with 3 fine extras:
- Blackfire is ready to go — just run ahoy blackfire [URL|DrushCommand] and you’ll get back a URL for the profiling report
- Xdebug is easily enabled by setting the XDEBUG_ENABLE environment variable in a developer’s .env file. Once that’s in place, the PHP in the container will automatically connect to the host’s PHPStorm or other Xdebug client
- A chrome-headless container is used by our suite which incorporates Drupal Test Traits — a new open source project we published. We will blog about DTT soon
Of course, we are never satisfied. Here are a couple issues to tackle:
- OSX hosts are still a bit slower than the old Vagrant counterpart. We are hopeful that Docker For Mac continues to speed up filesystem access
- MySQL can be slow to start up. Briefly, Docker’s Overlay2 file system has a copy-on-write mechanism that forces copying of several gigs of data at container startup. Fortunately, mysql startup is a relatively infrequent event
Safe External Links (sel) is a topical module which addresses user editable external links on
a Drupal site. It processes links and adds target="_blank" and
rel="noreferrer" or rel="noopener" attributes if a link is external .
In this chapter of 'Game Devs & Others: Tales from the Margins,' dev Vanessa Paugh writes about how she joined the industry because she couldn't find her 'perfect game' -- so she set out to make it. ...
This week's longform game writing/video highlights include a report on the latest Pokemon Go Fest, the return of Sean Murray & No Man's Sky, and lots more besides. ...
The OpenAPI UI module implements an API around displaying OpenAPI specs inside a Drupal site. This library implements a plugin base which can be used to initialize a API explorer UI within your site. This module does not come with any implemented plugins, but implementations for Swagger UI and ReDoc are available as Drupal modules.
A lack of off-the-shelf eCommerce software products that could meet the unique needs of her family’s biotech manufacturing company was a real issue for Lisa Streeter. “We’re not a big enough company to afford large, custom database solutions, so we needed to figure out how to do everything in-house,” she explains. (Lisa’s work responsibilities included everything computer-related, and “some other stuff.”) That’s how it started, but instead of just a solution, Lisa Streeter wound up with a whole new, fulfilling career.
Her initial quest for a database solution quickly began to grow her fascination in web development (primarily eCommerce,) and lessen her interest in the family business. “I like the idea that in web development, you’re actually building something, architecting information rather than just analyzing it,” she explains. She fine-tuned her focus, and after discovering Drupal, began to seek an effective way to become proficient.
“I don’t remember exactly how I first learned about Drupal Career Online. I didn’t know anybody who did anything with Drupal, so in the beginning I was just trying to figure out how I could learn Drupal," she explained. She tried some self-teaching methods, but those were not providing her a clear and effective path forward. DrupalEasy was regularly popping up in Google searches and referenced on sites like Drupal.org. “Early on it made my short list of potential “good places to learn Drupal” and then it was just a matter of finding the right time,” she recalls.
It turned out the time was the Fall 2017 session, and according to Lisa, that’s when her interest took a fast track, “I started really getting Drupal. It was a transformative experience.” She dove into the curriculum, participated in class, and DrupalEasy matched her with Matt Glaman from Commerce Guys as her mentor. From there, her path became clear and direct. “DCO was just the right level of time commitment and intensity for me. It demanded enough of my time and effort to really accelerate the pace of my Drupal learning,” she explained. “At the same time, while I needed to give the class my full attention, it didn’t completely take over my life like going back to school full time would have,” she added.
The online, live instruction by an expert in Drupal and training was a great fit for Lisa. “Mike is an exceptional teacher who helped me really “get” what Drupal is all about, how to do things and think about solving problems in the “Drupal way.” This was something I wasn’t able to learn on my own from books, screencasts, or trial-and-error,” she recalled. She also appreciates the small class size and Mike’s personal commitment to everyone enrolled. She explained, his “personal interest in getting to know every student individually made the class seem tailor made for me, even as I could see that it was also meeting the needs of my classmates in different ways,” she continued.
Mike Anello, (@ultimike) has been a part of the Drupal project for more than 12 years, and developed and has been delivering Drupal career training since 2011 via live in-person and online sessions and contracted programs with organizations needing to train their development teams in Drupal. His curriculum has become the model for the development of several other long-form training programs. He keeps alumni connected and engaged in learning through the DrupalEasy learning community, which evolved from his weekly online office lab hours. According to Lisa, “When you take the DCO course, you definitely feel like Mike is personally invested in the success of each and every student.”
With her interest in ecommerce in mind, Mike connected her with mentor Matt Glaman, a Drupal project maintainer and one of the Commerce Guys. “For me, this resulted in a perfectly matched mentor, one who challenged me to tackle harder problems than I would have thought possible,” she said. Matt recognized Lisa’s passion and talent, shared his insights with Commerce Guys partner Ryan Szrama, and then according to Lisa, “It all happened pretty quickly! “ The DCO ended just before Christmas, and she was offered a position on January 16th.
This fast track is a result of Lisa’s passion and Commerce Guys confidence in her abilities and training. She explained, “Ryan decided that he’d rather not hire me as a “Junior Developer”, even though there was an expectation that I’d be learning and working to improve my Drupal skills. Instead, I was hired as a “Drupal Developer,” with the understanding that I’d take responsibility for my own progress.” It appears she has done just that, since in addition to serving as a developer, she recently was given the opportunity to be “Documentation Lead” (in addition to continuing dev work.)
Six months into her new career, Lisa is clearly fulfilled. She recounts, “Before I started at Commerce Guys, I was worried about whether I could really handle a real, professional job (working for someone other than my family) while also being a stay-at-home mom. But Commerce Guys has been a perfect fit in that respect. Many of my coworkers also have young children - everybody at Commerce Guys has been very gracious and understanding about my time.”
In addition to her documentation responsibilities, Lisa is currently doing site building, writing custom code and site administration. She also works on Drupal Commerce and related contrib module issues. “I write patches, including automated test code. Someone from the team reviews my code and gives me helpful feedback, which is also a really great way to learn and improve my coding skills, with the bonus that I’m directly contributing to the Drupal community,” she explains.
“The best part about my new career is that I have a “career.” For years, I’ve had an ambiguously defined job at my family’s company. I didn’t report to anybody, and nobody reported to me; I just “fixed” lots of random problems...I had to invent my own job title. So being able to say now that, “I’m a web developer” is pretty awesome!
She also loves being part of a team, she explains “After so many years of working independently, it’s great to have job that involves a lot of collaboration, especially when the people I work with are so talented. And being part of the Commerce Guys, an organization that strives to make an impact with the software it creates, I have a sense of greater purpose.”
Even with all of her success, she highlights that she is still learning. “In DCO, Mike talked about how he’s continually working to improve his own skills and how that’s something you need to enjoy doing to succeed as a web developer. I’m finding that to certainly be true for me. It’s just a really good feeling to be able to look back a month or 6 months and see how much I’ve learned and improved since then,” she explains.
Visit our web site to learn more about Drupal Career Online, attend an upcoming Taste of Drupal free mini webinar, and check out our career resources for information on web developer and Drupal-specific careers.
Module for getting feedback from the users and monitor the feedback.
Unicode characters encoded using UTF8 can technically use 1 to 4 bytes to represent a single character. However, older versions of MySQL only provided support for storing UTF8 encoded characters that used 1 to 3 bytes. This was enough to cover the most commonly used characters, but is not suitable for applications that accept user input where any character can be submitted (like emojis, which use 4 bytes). Newer versions of MySQL provide a character encoding called utf8mb4 to fix this issue.