Get Started with Local Development Workshop

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay well let's go ahead um and let's just we'll go for it like i said it's great to have great to have a smaller group um i am just going to share my little outline of the whats and whys and wheres here so let me just do that um share my screen i'll just do this um this isn't a very complete or anything like that i just i just wanted to i just wanted to make sure that everybody had the framework in place and so forgive me if i'm repeating things that you know already the the primary purpose of having this session today that we're in is to get people ready for tomorrow's contribution day make sure that you don't have to spend your whole day trying to get a local development environment set up the secondary purpose is to introduce you to um ways well introduce you to the d-dev way of having a local environment um so that you so that you have that so that's the those are the those are the two purposes and you're welcome here for any of those purposes and you're welcome to ask questions about anything anytime that's the that's the lovely thing about having just a you know a nice small group here is feel free to comment uh you know bring things up say what uh what you think is important feel free to unmute anytime you want with a group this size we are in great shape so that's good so why do you need a local environment in the first place it's like really really important to have a place where you can experiment and work and work predictively and not be working on a server or something that doesn't have a controlled environment or something that you might mess up or something that you might be careful around you don't want to have to be careful when you're doing development you need to be able to take all the risks that you want and do stuff and make it you know make it work or not and you want to be able to have a repeatable situation people who have a shared dev server or who work on a server on a live server they never know what they're working against because well their colleague might have already changed something and you know it's a very bad situation so having a space that is your own is a key thing so that you know how to get it to a an exact situation that you want it to be in and um that you can get to the right branch of the right code this all has to do with having your own um having your own source control as well and and knowing git which we've all come to know know and love in the last 10 or 15 years so so now the next question is um all the all the cool kids are using doctor-based local environments now so almost everybody is using d-dev or lando or doxel which are all three wrappers around docker compose which is another wrapper around docker there's all kinds of great reasons for it and i know that several people here have been using virtualbox or vagrant with virtualbox and it was a time-honored thing in fact i spent i spent two or three years with tag one maintaining uh painting a company's local environment using vagrant and it matched it it used puppet to build their environment exactly the same as the server and it was great but the resource is very very resource intensive could take ages to build and uh virtualbox is um kind of fading out of use on both mac and windows and linux now it's always been a little iffy but on windows you can't use it uh well you can use it with hyper-v but it slows down quite a bit uh on mac it just doesn't seem like people are using it and on linux um there it's hard to understand why to use it um so a virtualbox does seem to be going away um and i you know um i don't know whether any of you were there on uh was it yesterday or wednesday when uh they were doing a local setup of night watch and you saw all the trouble that mike herschel had with trying to do it locally uh piece by piece um doing when you set up you can set up your own local environment using regular tools like nginx nginx will run on any of these environments windows even but you're setting up your computer for a specific situation and um then when you need to change it you have to change your computer and it doesn't work for that other project you're working on so when you use a docker-based local environment you're not changing the configuration on your workstation you can do you have a consistent web server setup so if you're using dev you can change the php version just by changing a config you can change the mariadb uh version just by changing a config and a team can check in their config then they'll all have the same results and so i imagine that some of you have been in the position where your teammates or collaborators are are trying to get their local environment set up and you have to spend all your time keeping the team's environment going and that's not what you wanted to do you wanted to be developing instead so sharing config with it as a team is really important so a cool thing just to add about virtualbox um going through the threads and forums now with the upcoming m1 uh apple chips uh virtualbox seems to not working there so that would probably also create another shift of using using it less and less yeah virtualbox is never expected to work on the m1 because well because of a problem with the m1 it doesn't do virtualization and it doesn't do emulation so it can't run amd 64. well so the m1 can't do amd64 it can't do the the intel architecture and that's a problem also for parallels by the way a little plug for parallels if you were using if you're on an amd 64 mac anyway and you were using virtualbox parallels is so great it is so much better than than using virtualbox it's so reliable great performance it does cost a hundred dollars a year or something but it's way worth it any other comments or questions um yeah that i think you know when you're talking about repeatable environments you know if you still need to use vagrant virtualbox that's okay because you you know part of you know why you have those those those things is to make it production-like and and i think there's still a use use case for for using puppet and chef in in in your local environment because you do want to match those expectations so if you're if you're where you're you're deploying to is a puppet-based system it's you know you it is it is wise to keep it as consistent as possible but if you're deploying to a kubernetes or a container based environment then it probably makes more sense to to switch over to something similar so you have that that repeatability and the consistency between your local and what and so what that means is when you make a change locally you have a very high expectation that this that change is going to work in your remote environments in production or stage or development or whatever and so if if depending on how you know what what your production environment is you know virtualbox might may still be something that you you need to use but more and more people are moving over to those those container based deployment patterns and so something we want to it could be better to shift over it um your locals so you have that repeatable repeatability and consistency the um the i think i think it's really important to emphasize that the bottom line is repeatability in a known environment in a local environment that's the bottom line there really is nothing wrong with virtualbox or vagrant um there's really nothing wrong with the with a hand done local environment if it meets your needs um if you can if you can build it consistently and and maintain it consistently um but uh it's just uh virtualbox the weight of it is the thing at this point so so i've been thinking i've found a number of people who have been asking recently like they they're new to docker they're wondering what in the world all this is or they come to dev and they start trying to use composer directly and they wonder why their composer isn't configured correctly and they're not using composer inside the container so i'm trying to think through how to explain how this stuff works and this is the same with um with d dev orlando or doxil that docker essentially d dev and all the other tools essentially use docker compose to start little isolated virtual linux computers they're they're like several little linux computers running inside virtualbox um or wherever i mean that's not exactly the technology but that's the easiest way to think about it so when we learn how to use dev and we start out and do it dev is going to start up a web server container and it's going to start up a db container and a couple others that you don't have to think about right now but normally it starts up uh four or five little containers which you can think of as little linux computers and you can actually ssh into them and do things inside of them and all the web serving is happening inside the web server container and all the database serving is happening inside the db container and that might be like your deployment environment but it is not happening on your workstation or on your laptop well it is happening there but it's happening in a completely isolated environment so i'm hoping to to write a little intro to um the architecture of dita to try to help people understand that because i find that newcomers often just don't um just don't necessarily um understand what's going on at the beginning you have any questions or comments on docker i i really i put something in the chat regarding what you just said on with okay using dev composer instead of just composer i just pasted in the you know usually when i do a composer project i just you can go what you see right there in the chat with the exception of dwb and so yeah so that that's as simple as that right that's what you're saying unfortunately i can't see the chat um so i'll have to figure out how to see the chat here let me see there we go um yeah that's exactly the that is exactly the technique um although um in general i try not to give it an explicit version but that that works perfectly um and there we will um actually since you since you said that let's just go um and i'll just share my screen and share my whole desktop and maybe that will help me a little bit i still have trouble with the rest but if we just go to um google and we say dev drupal 9 quick start we will end up just in the docs at the right place um in the uh in the quick start look it has a 159 still being found in there um so here's the drupal 9 quick start and so this is um this is just the basics of what we recommend here can you see that okay yeah so this is what you would do um if you needed to just create a regular project not a git checkout project we're going to be we'll talk about quick sprint in a minute but we're going to do a git checkout project because it's more appropriate for tomorrow's events but basically you just do the um the config in a new directory start it up which is actually optional because the composer create will do it for you this will bring up a drupal 9-1 project at the right now and then every every drupal project needs trash so that's it and ddev launch just pops a browser for you um so that that's basically what happened so that just to follow up on what you said so any other comments or what you just said is in place of just running um the steps on the kickstarter is what you're saying would be the right way to do it instead of just running that one command d dev create project blah blah blah well it's it's essentially the same you were just uh you were just um well you were just simplifying it down to the one command so yeah you had the one yeah all right yeah and yeah so what you were what you were saying is exactly right um i was just saying that to put it in context you have to do a couple of things like make a directory and config the directory i get it yeah randy can i share a quick question what's the difference between quick sprint and quick start uh so so uh i'm gonna talk about what quick sprint is in a minute but um this is um in the docs the quick start is just a way of talking about the fact that this is what you do so it's not a project or anything like that okay okay so if i had my own um you know php storm or something and i didn't want to use all the things in quick sprint i could just do these individual commands you you can do that yes absolutely you can do that um everybody um like i was saying everybody's local environment is fine as long as you know how to make it work for what you want to accomplish tomorrow or whatever day it is you know um so everybody's however you want to do it is fine i actually my we're going to talk about quick sprint in a minute but i have one reservation about quick sprint is that people tend to think that quick spread itself is important and it mostly isn't quick sprint is just a way at a conference to get a lot of people to the same place at the same time and for people's long-term knowledge i actually prefer that they know how to just use d dev and not you know not because quick sprint is basically two things well we'll go on to that hey randy can i just um you bet you interject one moment confusingly um quick start means multiple things um and what we're talking about here when we talk about quickstart is specific to dwev's documentation so if if you're looking to spin up your d dev uh an environment for your drupal project with ddev um that is that the term quick start here means um going into the documentation and be able to do that specific task there's also another terminology in the drupal community where quick start means the the three-step way of getting a quick drupal demo up and running on your local computer without docker without virtualbox and you only need php and composer so just to add that to make so if you're searching for the terms quick start and you may in drupal you may find that instead of what you intended to search for which was dev quick start or dev quick spread or drupal quick sprint so just decline just to clarify for for those people watching later or or or just keeping in the back of your mind uh there is that terminology as well thank you randy thank you yeah um that's it that's absolutely correct um so what is quick sprint so uh quick sprint is a project that was um quick sprint is a project that was originally built for um for these um conventions and stuff because the internet is typically terrible and we want people to get to the same place at the same time and so what we would do is hand out the whole thing on a flash drive or on a local lan or whatever or get people to pre-download it and then we can have people all start up at the same time without having to do huge downloads and also doing the you know just doing exactly going through the steps and so for those of you that want to today um especially those that are new to dev or that or that are new to core development uh if you're planning on working on the the theme tomorrow um we will go through the quick sprint install um and it's um if you if you want to use it and you haven't already downloaded it it's here and releases over here on the right so and i think that was in the the links of everything too let me just put that okay but i have to quit to be able to paste it okay now on the release page there there are two sets of kind of packages there's the drupal sprint package and then third-party installs the if you've never used docker before you'll need to download both of those um packages if you have if you're comfortable with docker then you you really need the triple sprint package uh tarbo on windows um you'll need to get install as well so if you're using traditional windows yeah so anyway so here uh so it was built for in-person events but we have found that having everybody on the same page at the same time with the same package is worth something even in virtual events so um if you have you feel free to go ahead and download that now if you haven't downloaded it and if you'd like to walk through with us it it builds a drupal core contribution environment which is git based it's not a it's not a composer a composer create project so it it's built in a way that you can do patches against drupal core so that's the basic ideas for core development and really if you've set up with if you've set up with quick sprint and you want to go forward with ddev the only thing that you really will probably want to actually remove the manually installed ddap binary usually in look use your local bin on on mac or or linux remove that and install it in the normal way which is you know usually home brew or chocolaty or something like that so actually on windows you can just switch to chocolati you say chocolaty install vito and it'll uh choco install ddip and it'll be right there so okay um any questions before we go forward uh which which uh package should we install from that from that link so um have you do you have docker already on your computer uh no i don't think so i'm on my personal computer okay so what you'll want to do is you'll want to download both of those and so um another question would be if you're on window it's going to depend kind of on windows or mac or linux so if you're on windows you may not be able to extract the tar.gz files first and since windows has native zip file support so there's the zip file is mainly for for windows users whereas target files are are easier to use for for on mac os and linux okay so you're looking at zoom uh now you're looking at the browser window is that correct yes all right is everything readable is the font size a little too small that's good all right so just to recap we're going to go ahead and click on the releases here the latest release is 1.53 you can go ahead and start downloading the drupal sprint package 1.53 here and then also if you haven't installed docker in a long time or do not have docker yet um click the quick sprint third party installs um link here as well this this one right there and that one right there so i downloaded that highlighted gz file was there something else i was supposed to download sorry uh i'm just trying to get that chat here uh you want to download the drupal sprint package 1.53 tart tires on gz this the one here that's highlighted and then in order to we also package docker the docker installer in this quick sprint third-party installs dot v 1.53 1.53.tar.gz so that you'll want that one as well even if i already have docker running if you already have docker running and installed and it's a recent fairly recent in the last year or so two year and a half you don't need to download this quick sprint thirds third party installs if you do have docker running let's make sure and you use lando or ddev or doc sal or or any other doctor solution let's go ahead and make sure that you've stopped on any of your running environments how would i do that did you see how did you do that i'm sorry i didn't say how would i do that how would you do that okay so um as a if you're if you you're going to want to open up a terminal uh window in either on mac or on linux and of course i can't see anything now um you can run can you read my terminal here at the top yeah i'm just saying a prompt right now attempt um you can run the the docker command um this is just pure docker um commands uh docker ps will tell you to show you any running containers um and then so and there's a container id here that you can copy and you can always you know run docker stop that container id and this is manual docker commands this is not um if you're running lando there should be a command where you you you change directory into your lando directory and you call lando stop or something like that i'm not a orlando expert yeah it's lando stop um so you'll want to do that or if you already have a ddev environment and you're it's currently running you'll want to change directory into the that into your data project directory that you already have and run dev stop so when you when you've when you've downloaded um the uh so you've downloaded these two packages where they're downloading you can also let's click back on the code here and scroll down you'll see the readme um and this is what essentially i'm gonna run through as well and and to overview the first thing to do is getting the files so that's what you should be doing already by by going through the the um the releases page so we're very past step one um the second step is you're going to extract these these two these two packages the example here shows zip but we're using tar.gz the if let's say i've downloaded i download these to these two tarballs to the same directory when you extract them it'll actually create it'll put everything into the same into the same directory so as an example let's see i in a temporary directory here i have a whole bunch of these things and i'm going to run a tar zxf which is going to extract a tarball and then i'll provide the the first the drupal sprint package by doing the ls command in my terminal i'll see triple sprint package and so now i can do the quick sprint i can extract it quick spread third party installs and what's what this is doing is it's going to extract it in that same triple sprint package directory now if if there are a lot of linux um um users here uh we don't include docker with uh for for any docker and solder for linux because there's so many distributions so in order if you're on linux and you don't have docker installed you'll want to click on this linux instructions here link and most i think most people are using one of these distributions and so there should be instructions for for downloading docker and docker compose for your for your distribution i'm the oddball out i use software so i i have i'm down here in other and i download binaries manually if you're on a mac um you can open up the drupal sprint package directory that you've extracted in finder and when when you're looking at that you're going to see a installs directory and so you can open double clicking on that you can see this docker dmg file so that will contain the docker installer which which you can then install so that would be i think now i've skipped ahead past the drupal sprint directory to the install docker and other requirements step so the the fourth one at you know after you install docker um you'll want to make sure it's running uh that's something i've forgotten in the past is to make sure that my dock is running and i'm like why isn't this working oh i need to run docker uh so if you're on linux there's probably a service in a system system d service or um or definition to start docker if you're on mac once you install it it should it may run by itself or you could um use the spotlight search tool to search for the docker application or docker desktop and start running that and it will take you know a little bit to start up uh docker desktop for for mac and docker desktop for windows these days when it starts it'll it'll pop open a window and it might ask you to log in or create a docker account you don't need to do this when you're installing docker you can safely just close close those windows um so i already have docker installed um and if i if i was installing from scratch you know i have my own system in place oh sorry you're gonna watch me fat finger my thing i'm gonna do this in a different window so i don't uh i don't feel pressure but you know i'm gonna um so right now i'm just being nervous really okay we're gonna pretend i restarted docker can't laugh at yourself you know all right so i've installed docker it's running i can test it it's running by doing that for quick sprint uh the next thing i'm going to do here is is i'm going to open a terminal i'm going to make sure i'm in the drupal sprint package and then i'm going to run install.sh like that and this is the same as if you're on a mac or on linux and it's going to tell you what it's doing here it's it's going to install the ddaf local development tool it's going to preload all of the docker images that you just downloaded so you don't have to download them and then it's going to create a directory within your home directory called sprint um in i already have the images loaded but let me um so for you it'll probably scroll by a lot of kind of uh gibberish or hashes will scroll by um at the bottom here it's gonna print out this useful information so we want to make sure we don't forget to read this so um it's going to tell you in a new window so we want to open up a new terminal window go back see back into that drupal sprint package directory and um so you know we want to refer back to what says so we want to run the mk cert hyphen install command and then it's gonna say okay now change directory into the sprint you know your home directory sprint so again let me go back to the instructions here just to say and it's we're now we're on step 5 so i want to change a directory into this into the sprint directory i have one extra step i have to do and that um since i'm i'm special i'm just going to be in my in my uh python environment um and again the last thing it's going to tell me to do is run start sprint and what this is going to do is is it going to create a directory kind of like what's up here sprint is going to create a new environment every time you run the start sprint command um with the the current year month and day and and hour and minute once it brings up the it's going to start these docker containers and once it finishes starting those docker containers it's going to install drupal for you or update drupal to the latest 9.2 x which is the the development release run composer inside the container and then installed your tool okay i'm getting the fail to listen on unable to listen and acquire ports the port 80 message which i was getting before but when i look at the config.yaml file i don't see a reference to port 80. i had changed it to like some other port all right so um okay so i think what that means is you if you're you're running on linux yeah i've i have run into this in the past when i was on an older version of my my linux distribution and i mean updating it eventually went away but well i'm thinking about rebooting i'm wondering if it's some hangover from someone else you might you might have another environment um running on on there but it should bind what's trying to do is it's binding you see how it says 8080 here it's this is the public work but there is the um inside the docker container and we're getting kind of into the technical details here there is a d dev router container i think we saw it here this this dw router container is running um engine x and that is buying trying to bind to port 80. are you changing it in the config yamaha and the djiv we can do that because i've been into that issue and i always have to change the portrait another one from 80. i usually use 8 000. i've tried various values of that port in that in that folder though the configuration i'm not sure i'm not sure i'm in the right folder so it's a hit it's well for me you know i know you might be in terminal but um if you dev dot d dev holder the concrete um you have to do it if you find it um and um make sure it's changed there okay um so i think the this might be slightly different uh the config the d dev configurable that gets auto configured here in quick sprint um already has okay here's one here's here's another thing before i get it get into that um we've run that start sprint and so i'm still in this spread directory so i i kind of want to make sure i change into the um into a specific environment so let's get it created this directory here in this directory there's a drupal directory so i actually want to change it to that as well so my configured project is in here so i have two of those directories one ending in dash 12 13 and one ending in dash 12 27 so which one should i use did you run the start sprint multiple times i don't know maybe um so these are encoded with the date so if it's 2021 3 26 that's today yeah and so whatever the latest one is there okay the one you want to be in i'll remove the other one uh if you're if you're using if you haven't used dev before um you probably want to not just remove that directory so if i go into my old one here and i go into the drupal folder here i want to run ddev's um remove hyphen o um and that will just that will remove all the containers and kind of clean up and div and it'll just kind of clean that that project up okay um it will you know if you just delete the directory it will leave things um some ddf configuration and so did it might think you still have that site but then i can't find the files okay so i did that i removed those containers and then then it would be safe to come here and remove that all right so i'm going to go back to my my current local environments drupal folder and just kind of describe what's going on here there's a you know this is drupal core um just checked out you know clone of drupal core there's this dev directory here and that's where where everything is kind of pre-configured and we shouldn't need to do anything there but if i'm if i'm if i want to stop my project from now because if it's running you know this is where i'd be like okay i can run dw described tell me what the state of of this site is and i can run devstop to stop doing things just like uh what we're doing if we're removing it and if i want to re try again i can just type d to have start so now that you you've deleted that um that problematic um old one why don't you come back into this this other drupal directory spread sprint hyphen whatever the date is and run devs start or dev stop repeat the restart command will stop and then re start again okay dw restart stopping dba web tv so and just for everyone else i'm going to go ahead and copy it'll give you both an a a regular site and or an http site and an ssl version and just to show it's kind of working here on bugger still getting the it's getting give me port 80 is already in use which i find confusing is it really trying to access port 80 or is that just a generic message i believe that is again the ddif router yeah it is dj browder because if i do ddf's status it says and describe says uh the router's not healthy and what i remember about this is there's is this is a permissions issue with how docker is set up on your specific linux distribution and if you if you didn't install docker this time perhaps okay i can go back and reinstall it um yeah try to update docker to the latest one which might kill all of your images and containers okay i did that this last week i updated from docker 1903 to 20. 10 i think and it i had to all my containers were gone okay so i'm on docker 2010 10.5 yeah same as yeah okay so at this point i've kind of run through things i want to cover something extra um before i start kind of i'll stop sharing and we'll we'll kind of see where everyone else is at and that is uh matt lammon yesterday you know wanted you know and and for tomorrow i wanted to show how to run the night watch tests as part of contributing to drupal core and there are a couple of files here i think his was on a new beyond no it's bluehorn digital price and beyond um but he has a [Music] this github project i'm gonna go ahead and paste this into chat which i haven't been paying attention to and i'm sorry whoops i'm sorry joanne i did not mean to do that and there's a couple there's a couple of files here um that we can actually just download and and see this dwev directory i can i can just download this docker compose animal directly or i can copy and paste the contents it doesn't matter so if i did that and i said okay i should let me stop my i'll do i don't have to was it docker composed testing ammo so i can paste that directly in and then he's he has these two commands one nightwatch and one php unit these i can't actually use directly i need to modify them and the one modification is that is i need to just um change it so it's instead of going one directory up i'm actually like that and the same with the other one so if you look here it's it's just we're one directory or dot dot slash vendor but in our quick sprint we're actually just vendor bin php unit we don't have to be one directory and this will get us set up for doing oliveira work tomorrow is this something that's new i stumbled into matt's presentation on twitch the other day wait that's not what i want uh so in this in this case what we want to do is we want to have it var www.html so if i in my in my drupal environment here right i have my dwab directory i run ddev restart it's going to actually it's going to stop the connectors and it's going to pick up that i've made this change to um and added this this new yaml file and this might take a little while because it's going to have to pull in this new container but that will i should now be set up to run those night watch tests all right so if i if i run dev i can see that i have a new command called nightwatch and i can run that oh i don't actually have um all the dependencies so what i i need to do is type ddf ssh first so this will put me into the container i need to go into the core directory in the inside the container if you're on linux you can do this outside but it's safer just to to do inside the container if you're on a mac on windows you would need to do this inside the container i can then run yar i need to run yard install running this inside the canter again keeps our environment consistent and remember what randy was talking about earlier we want reliability and consistency in our environment okay so now i should be able to run that command and this will run all the night watch tests in core that'll probably take a while um maybe about two minutes okay i don't think we need to actually see that run but that's that's our goal today is to get set up not only with quick sprint but for core development but to also add in this this extra step for tomorrow so that we can work on oliveira so i'm going to stop sharing and now i want to see where everyone else is at with their environments i'm just working through the extra linux steps right now when and now i'm looking at chat mike the so you've got the permission denied on this on the docker diamond socket can if you run when you get back to having docker installed can you make sure you run docker ps to see if it's running all right oh i see you said sudo docker run um so you probably need to you might need to add your user have your user have a group um that to be able to run docker okay so uh panda is that your name like you can pronounce that correctly uh so here's look at the post installation steps for linux um so at this point i think um what we want is is is probably the best is to share your screen but to do that i probably want to stop recording and pause the recording um so um just so we don't share things was i on mute that whole time because i was talking i was talking to you oh yes i think so i was running it i was running um i was going through the linux post install um documentation for docker um and that seems to be getting close what you said is correct i think i need to get get my user in that special docker group which i believe i did and then it looks like there might be other stuff i might need to do so my my docker installation gave me a docker user and docker group um so if you type the groups command and right you can see what groups you're in yeah and then i'm in uh the docker group but i i did i tried that docker ps and there's nothing running right now but you didn't get an error right i didn't get an error just just for trying to run docker ps did you run it with the with sudo or did you end up with your current user current user so i might be able to try it again try running the install but i'll just try it why not okay so um now um yeah go ahead and try that and let's look at let's kind of look at the other thing i'm going to go ahead and pause the recording since we're doing more support stuff at the moment okay it looks like it's working now
Info
Channel: MidCamp - Midwest Drupal Camp
Views: 52
Rating: 5 out of 5
Keywords: MidCamp Chicago, MadCamp, Drupal, Drupalcamp, MidCamp, MidCamp 2021
Id: cgUMkfpmSVs
Channel Id: undefined
Length: 57min 1sec (3421 seconds)
Published: Sun Mar 28 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.