Bestand wählen

Infrastructure as Code: "pip install" your environment

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Erkannte Entitäten
the next talk of the session it's in intersection of those who would decide your environment that is gentlemen mutual tends Boston not about were few yeah thank you so people come have seat so we the that's the vital infrastructures hold installed your environment uh life to disclaimers so the first one is this talk not about it so if you if you because you want to learn something about this I'm sorry it's really need not be it has nothing to do with people that it's just a metaphor then the other display mine not a computer scientist I'm not an expert on a physicist and data scientists so everything around infrastructure is just portal didactically returned by me so if you find something wrong and just keep it for you and for granted so OK yeah I work at beyond the maybe you saw that stand over there so just come by with and we can have a small chance OK so a small
outline and maybe maybe a question so for example some of year operations 1 2 3 yeah OK so addresses will of what and yes so it's more or less 2 parts so the 1st part is small as this theoretical thing on it's a introduction to the all the words so a glossary what infrastructure all what
is cropped for example you see already the immutability
what is the infrastructure is cold and then the 2nd part that this weekend on so we see cooled we do all this stuff and maybe we do a short short question around between those 2 parts if there are any questions so that the 1st part is really everyone knows what is infrastructures cold what is
infrastructure as a service and so on OK so ready we start what is crap or C R U D it's trivial so it's
just create read update delete and it's just a simple set of operations but as we will see in the talk is a really powerful operation so now this is a hypothesis of me nearly everything can be implemented using using these 3 operations so for example think of a block you can create a plot reader block update a blog posts deleted to where all E C 2 instances who can create you can leave the dictionaries in Python can create item and denied them all the use of everything what you can think of can be
expressed somehow in these terms create read update and I the next thing also a hypothesis if it's wrong you can correct me afterward personal and if we implement such things with this simple set of operations you morally that you moralist get the rest API for free and we see that in this and so was of
rest API for looking for quite a few so um yes there's this really one-to-one correspondence between those rest Burke's if you use HTTP suppose create debt is read put is an update and delete history so really see OK there's some kind of correspondence between these things not the next
thing what is the mutability so this is really a hard thing and it's not me down it's not the uh the theoretically need down definition what you get here so that 2 numbers here in 8 and 9 so this small question out to the audience what do we do want to come from the initial state the 8 to 9 would you really do it like that so I want to the answer so what what would what would you do that yeah we removed it did did you have a lower of course I mean imagine if we Stonehenge and of stones we would remove the 1 and then we have in mind but now is the question if we would have implemented a kind of a robot which which has to do with what we have done it the same way just imagine what would you would have the a camera analyzing with some kind of computer which is the initial state and then find transformations from how to get from an 8 align and then the next thing is if you want to come from 7 to all from 7 to 9 so it's really it's an explosion of complexity because we have every combinations of initial state final state so what would the public to Robert if we would build a robot public we have implemented and there's going to be we would just have a white 1 kill all the matches sort them somehow put them in in the little box and then put the robot the 9th so we just need to have for 10 digits we just leave 10 instructions how to come from the initial state 0 everything in the box to a 9 2 8 2 7 6 5 4 3 2 1 10 instructions and we're done so that's
I don't know if it's correct but and update can always be implemented by deleting and recreating but deleting in recreating in the real world is often quite resource expensive so that's think of holiday do we really want to tear down the halls and build it up again just because the color of 1 room need to change from blue to red writing a book need provision server that can take quite a while to have a server running exactly in state you want to have a if you do it by hand but on the other side making an update so come from a 9 to 10 can be quite difficult and complex think of the combination 7 2 9 2 1 so for example if you want to add a room to a house can be really complex so maybe down it's easier to tear down the house and rebuild it with the with the with another rule you want to
change the structure of a database that everyone knows who is use with the land because of some kind of things that I can be quite hard sometimes it's impossible or if the task we change the color of 1 of these objects what's also really so that's falling down a bit humans are lazy but intelligence so what we are
doing is always the update so we see that there's an 8 hours a nite we just have to remove 1 we optimized for least effort machines that the but down 4 days for them deleted deleting in recreating is the preferred way to go survive everything at op and rebuild it from
scratch the question is what is the current infrastructure you are working in at the moment just think of what's your daily business in this infrastructure where you are working this just a question to think of how we so who is working
in an environment which is machine driven so deleting recreating so and now
boiled down completely was immutability immutability is a concept of how to change the state of the system it sounds paradox but it isn't so immutability is not about not changing
anything so it's about how to change it and how to change it is really easy we have a policy our unity which has the lead the
and we adopt that's immutability so we do not do an update we just delete and recreate our now I really
small the pressure calls for just as we we know what are talking about being laid off the 1 and 2 examples but everyone knows already we know it so normally read something like a collection resource let's say some kind of instances that state police's or things like this all may be better to do to
boost solar collection of to do was with get we get a list of all to do with them with the post you
create you to then there's the instance resource that's the 1 with the idea behind it with the get get just to do so what to do in this particular thing we can delete it and we can update this particular instant not to sensed something completely
different so we a computer people what is the infrastructure I mean that's a quote from each other don't take it too seriously infrastructures everything what brings you better go to life this
means everything around deployed or J. store's key-value stores databases routing networking the the identity excess so everything around you code which is in this is what I call infrastructure In the end it brings the the value and in addition with you called knowledge that's the
title of the talk what is
infrastructures this cold it just means if we can access
this infrastructure so the p-values for all the memory or things like this and In alternate fashion by a machine consumable API is so now we heard quite a bit of cpi stressed PPI crop and how to change states so here it would mean infrastructures support means to change something there should be no tickets to assist doing things all you need a screwdriver and tries to your data center and maybe also not an admin SSH terminal because he needs to do type some secret past for got and of course we so we need machine
consumable API so now In addition to infrastructure is cold was infrastructure as a and this just means that the
application itself can consumed infrastructure it runs in so infrastructure as code could also be done the safe from the outside so someone provisions the infrastructure part that's everything is written in code and not was comprises and because erm but as a service really means the application
itself can create the infrastructure grants and this means self-service it's really like in a supermarket you walk in and say OK I need ObjectStore and you know what I don't know maybe that is 2 instance and so on for this we need simple machine consumable API of course
some all identity access management so not that the machine can by 12 million see 2 instances and you don't know you need something to control it yeah and of course no dependency in this whole thing to any school drivers all got some stack overflow deploy instructions so it needs to be consumable by machine
readable in the eyes so the next thing after the infrastructure as a service is
immutable infrastructure but not that's good we we already know what immutable infrastructures from all
the create read update and delete things we just delete the update things so we say that there is no uptake of any state what we do is we delete the thing that we're working with and be recreated in the new state that is in immutable infrastructure now we learned
a lot maybe board but why is it so important to have this automation so everything around automation and infrastructures code automation means the machines it so we reduce human error or we enhanced reproducibility it's of course cheaper maybe not always but sometimes it's cheaper it's faster most of the time and you also get happier developpers because sometimes they really had to do messy stuff in the console so it's and cheaper and faster is not this particular you not the most important thing most people think we need to automated if it's really a cost factor or it's if it's too slow but that's not the case it really is so that the reduce human error for example is really it's crucial
also if you build just once you applications is the 1 provisions it forgets tools correctly configured so that the baker it's just gone down once but it's done wrong so it's very important I think and why is this we can call it X as a service so this Infrastructure-as-a-Service why is it so important so why is it important that the application itself can consume the infrastructure runs and also called for me don't take it too seriously it means we can could ever everything so the entire applications
including the infrastructure and the version control and that's something really completely new never before we were able to put the whole application including infrastructure and version control and that's really that's a
crucial part so if you do go home after this talk and you know this thing and I think you learned enough that would be fine so that was the grace period and I think for the next part where we really build section
infrastructure as as a service for our own use and I think it's really crucial that you understood everything what we talked about so far are there any questions to the 1st part everything is here all not at all OK so then
let's go 1 and we built a prosperous as a service you together and you already excited a small requirement list so what should you do in the end it should
provide cost as well instances as a self-service these instances should be somehow isolated that means so if 1 instance get new the other 1 doesn't get new also if I choose a name like a test instance 1 it doesn't come back with there is already a database called test instance 1 but it's not from me but it's from someone some someone else so that that this means isolation so we really need to consume and we want to
set of things but of course simple machine consumable API and it should sum of all forces the state so if I create an instance I can then see how many instances are created and so on and as we increase store in some kind of meat that think this but and that's that's the most important thing it should be as
simple as possible that should be always the case so 1st we need
a name and I called it the post last the postprocessed service so that's good enough I think for a moment
that's designed this whole thing so a brainstorming so how could we provide instant cost who l instances any ideas stop right How should the API look like of course so we know already addressed in the eyes good just that we already know it it should be machine consumable so the update thing for us might be not so important it increases complexity from the
beginning which safe create and delete is everything we need um probably implement the API of course just
last we could use everything else but let's stick to this 1 it's simple and it does the job so the
1st thing stop we can manage
structural from Python there is a local client library who knows this the client library OK some few but not so much
interesting so it has nearly all features which you can access and native Python a native Prokhorov from Python from this line all it needs is a running dog of
demons you can connect by local running demon or remote human you could also use for example swarms of and there's a whole cluster of proper behind and at that's a personal view I think the quality is quite good I don't know Mrs. someone worked with that uh cough grappler Python client so I
had some box in the fall the American strange more 1 small example and you find that 1 or 2 parts so this is really good you can work with that so the 1st thing we need to create a prosperous instance and that's the whole cold and there's of course
some boilerplate stuff around but in principle it's the whole stuff so if you know what type it into the thing it would really run and would take it to the chart namely creating a positive scope of containers running apostasy in so we connect to a client so we take the image that's just Fisher prosperous image from then there's this thing create container and not does what it what it tells the name so we just say OK take that was this image name it like we want to name it give some of which in turn faults should be exported that's the normal was this the environment variables that we can't say which you we want to have which possible or uh and database should be named inside the clusters that's it then we can start this container report and everything is fine OK so to create already done now to get it's also really really easy itself once again we connect to the client then we can get a list of all running containers on the client so maybe there are other containers running so we just search for the right thing here young search for the main there's a bit of inside and you need to remove some smashed there but we can ignore that complete so it's really see list of containers and return the container delete what's going it's the you just removed that container with that I any questions here trivial OK then the RESTful API and we are now all really really experts in there already so we know we need some kind of a nice collection resources so we need to post-process instances so that you are I would be something like the
hosted the running a local store somewhere else left was
class instances then we give it some parametres 57 needed parametres possible use of name or the end of the name of the inference this should be then unique so this is really my test database application Sunday morning you and then just return the created instance
name that's it furthermore get a list of all instances is gonna get on this collection resource mean
get the details of instances the URI with the idea behind them and delete I think that's trivial so you cross the border then to the
last plot OK no it's a bit of code so if you want to have a small sleep you can do
it if you're not interested in how to implement in a lot of the go really fast through it so um what I used here in this
example is this last press tool package who knows that quite a few and so it's really easy to define uh the rest API using this package all you do is you implement so you make a class which is inherently the inheritance from the resource classes and then implement the uh the GET PUT POST delete methods
set the URI so all collection resources which which means we want to use for these resources and basically we're done furthermore for this persistent so that we can get a list of all its instances we already created which was used as a for but with some in some database for example a post test may be in a container OK so the 1st thing the collection resource as I said
we do the class and the young this it's derived from for resource thing we can margins and the but let's ignore this 1 so this is the get on the election results so everyone knows what's coming back you know that it's the list of all our created instances so we turn this thing then how to create a of course post class instances in the case it's of course opposed to the collection resource so the past some parametres but let's ignore orders the important thing here is exactly what we already uh uh Saul in the beginning that's all function which creates a prosperous instance using and then we just save all those information thanks in that it affects that's really easy
nothing fancy here the older instances also
with the get we get the details off of this particular hospice instance for example the user name or things like this and that the lead there's some more boilerplate mainly what happens if you want to delete something
which doesn't exist yet but we can
ignore so we just say OK from the database get me the details of this instance the user wants to leave and then let's go to all of the delete function from the program and then afterward if it's deleted we delete the entry into that data really trivial
laughter thing we have to do we set close your eyes so the collection result processing and the instance resource proposed runs instances slash ID exactly like we
designed it so we're gonna that's everything mainly it's imprint in principle that code some point promote called here and there but you saw everything really that's a question does it really
work so what do we have to do to bring it to life so we need a topic to be daemon running um and we would course this image so that it's locally available then restart the last syllable so you use of course every years Geist WSJ eyes so you want you want to use called just for the test and debug 7 then image initialized me that it and he commented
Europe was sold what to do
and we going into alternative 1st I means that it's you can do it what however you want it was can right was small client library with you we can just use curve it's quite convenient to have the body we want to send a small 5 called theories my post lost from chasing it's it's a quite good idea because then you can check in this file into your gets so you know how you created your uh you post this instance so with the current 1 we just say OK it's content chasing and we want to oppose or the collection resource we know what happens it should create a prosperous
and and anyway that the small alterations and it says OK
there's supposed cross instance running the ID is number 1 it's the 1st 1 we also have to to consider the couple contain idea here and the post the cost is possible on the terminal so maybe people make
and OK that's it and really weak and 1 important thing is the port here so we get dynamically assigned a port of this positive instance so everyone who creates now on this holds the
apostasy gets another port but we can connect why this small command-line who could fall what's this uh here local host but the we got back here With all users and all possible under that we have running post this week and immediate all we can use it in a small application or in some tests or whatever OK
I think that's nice so a short summary I couldn't get you can
have a look at at their contributions are very welcome of course and it's just an example but uh regional it is running now our companies in the year it's just my hobby projects but yeah it's really running so many many integration tests use it because it's really convenient you can have a new and completely uh virtually the database for every test but if you want to do that it's quite fast so you can have 1 in at at most 10
minutes until the auspices really up and running but most of it will be some some for small experiments like Wikinews you all you need now is a positive as well as the application of the maybe we also use it for productive services anytime soon and of course it's not bulletproof but there are ways to overcome also that this thing is not really the best
quality under uh lot so far we created all of them I think something like 2 100 hospice instances and when I when I looked it up was really 50 impostors instances running on a tool called to go by machine so it really doesn't need much resources it's really nice you
can try to can have a look at the code and that's the reason for this talk you should not just say OK there's there's 1 thing but it's really about you should take home off of this talk it's really easy we don't need obvious services for everything and wait until on until they are delivered and accepted doing what they should do for you but you can do it for your own you have all the tools now at hand so as an inspiration
for example you can take a menus step new delivery chain so you want to deployed application and there's always this nasty step where you need to write a ticket to users often for example because you need a directory on remote files so you don't have access to so you need to write a ticket can you please make a directory there because I want to put my OK a small group Cooper and now we have already an idea where used last with the rest of your life is the idea for this we don't need dock or we can just use the native of final thing you make you all and 4 delete this SHU you to our entry for fall create continued update we don't need and then we design API what do we need maybe a name of the directory maybe somehow the
Linux user name I don't know emissions water it's up to you it's your project but it's really trivial to implement and all you need mainly something like a rainy Sunday afternoon you type those 100 lines of code and you're done and you can and will impress your colleagues that OK so that there should be a small summary wrapped up so what you should take home today the obvious for
machine C R U D is useful humans see our to to be implemented as rest i my pieces most infrastructure can be expressed as the the that means we can most infrastructure expose while the rest API so if it's only C or D it's immutable and that's good for machines and it can be consumed from applications as a service Service and why is it important to be a success this yeah we can put
it in version control yeah and then the last thing was because is a nice example that which is it seems to be some hold true what effect here and yet that's it thank you as that would be thank you and be are there any questions or comments by the and thank you for the talk and it's interesting that you chose prosperous as an example of because I can probably imagine that all other services are easily tear down and build up again but a database is containing Dr. so somehow the not updating principle doesn't really work for that system thank you for the question I give you money off of that node so it depends for example I have a smaller internal data services the web service and I really implemented in that way but from a real database so the real data is stored as CSV files and I optimize the import of this use these files and normally I can do it with an with an update if it's trivial update like maybe adding a column that sometimes if it would be something else I would really just for example if this is now the machines can do it so it's cheap to build new ones so I can build a complete code of my application wait for 2 days and to the whole data as reinserted in the new state let's say In the beginning was 1 table afterward 2 tables it would be really hard to do we're gonna in 1 course to extract the data such that now are 2 tables from the content from 1 table before so I really can have global put the data there if everything is up and running I can delete the old 1 and new 1 this is the next productive so it works sometimes the only issues performance or resources if it's not possible to have a clone of this system than you need to have like the least people try to be quite widely there was another question but you're ready answers over there we have 2 more question an interesting about when you have this control over all your instances and something like that income to draw program for example when you have others do many instances for other dimension something like our best to set up that you need the solutions to actually easier control all the instances are not giving come to that problem and I mean and to share it with the cliques so you don't have to remember everything can you can our any execution tools from where can trigger I mean that you have for my example landmark instances and who have all virtual machines and I have around 200 years or machines and I have the problem how to control them from the point is to just think of anything from this point of view and I no so for this small example not yet but of course it would be possible so if I understood correctly it would for example if if the host would be really a lot memory if would go out of memory or something like this what part of it is different for each example of that you just want to test or something like that yeah so as a as a set of doctors appointments nice thing there is this book was warmly way can put a whole class of behind it and it would be worth it would it would I guess and I never tried it but I guess it would work out of the box when I just connect to a small things and then I could horizontally scale the whole thing so there's a would just then need some monitoring call what what's the mode and the whole cluster but I could just add machines to it it's it's not done so far it's just it's and it's a small example that we have there the question and so when when you do the data contain original interleave are a lot of garbage in the system for for example like unused volumes and stuff and then how do you deal with the garbage collector not yet so it's really the 1st 1st of all they are no mounted volumes we could do it for example in a moment of data volume of the Bosporus on the host so that even if we could reuse the data in the database even if we deleted and created a but it's not done so far so it's really ephemeral and I don't know so I never had a problem so far running on the systems since November or something and memories still find no problems are not I mean from for example that the uh was breast image that event is hosted in the in the Doppler how their the official was worse image act the chances that their volume director for in the job profiles so it means that when when you create the container from that image and the volume R is created for you and that the the volume that the these file-system it somewhere deeply in neural our in the file system of of your host system and when you deleted the container the volume that the file system is still there it is still on your host system so apt sometime in the future so you do and cow and count of that this storage of your house has arrived the is out yeah so in principle that's really it is easy to answer I deleted using instances and create a new yeah that's it so you're talking about real updating the thing and in the garbage grows and grows it's exactly if we work in this human approach where we just incrementally change things if you really do need and wipe everything and recreate if we we grasp the thinking that deleting recreating is better and most of these problems when it's just a set of basis this a joke of bits that I think there are they always but mostly I would write about you on the for the that that's the thing I would implement but the question that we have already time for 1 more question this is not the case that we thank
Statistische Hypothese
Trigonometrische Funktion
Radikal <Mathematik>
Kette <Mathematik>
REST <Informatik>
Profil <Aerodynamik>
Web log
Dienst <Informatik>
Ordnung <Mathematik>
Tabelle <Informatik>
Objekt <Kategorie>
Klasse <Mathematik>
Dienst <Informatik>
Virtuelle Maschine
Spezifisches Volumen
Inhalt <Mathematik>
Cluster <Rechnernetz>
Elektronische Publikation
Data Dictionary
Komplex <Algebra>
Wort <Informatik>
Dämon <Informatik>
Eigentliche Abbildung
Prozess <Physik>
Web log
Inferenz <Künstliche Intelligenz>
Kartesische Koordinaten
Komplex <Algebra>
Web Services
Prozess <Informatik>
Clique <Graphentheorie>
Lineares Funktional
Nichtlinearer Operator
Plot <Graphische Darstellung>
Arithmetisches Mittel
Isolation <Informatik>
Verkettung <Informatik>
Projektive Ebene
Parametrische Erregung
Virtuelle Maschine
Transformation <Mathematik>
Physikalische Theorie
Operations Research
Speicher <Informatik>
Bildgebendes Verfahren
Matching <Graphentheorie>
Dämon <Informatik>
Physikalisches System
Objekt <Kategorie>
Klon <Mathematik>


Formale Metadaten

Titel Infrastructure as Code: "pip install" your environment
Serientitel EuroPython 2016
Teil 54
Anzahl der Teile 169
Autor Neubauer, Sebastian
Lizenz CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
DOI 10.5446/21221
Herausgeber EuroPython
Erscheinungsjahr 2016
Sprache Englisch

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract Sebastian Neubauer - Infrastructure as Code: "pip install" your environment In this talk I will show how to build your own infrastructure- as-a-service on the example of "Postgraas", an open source postgres- as-a-service I wrote in python just for fun. With a simple curl request you can get your very own database, just like RDS on AWS. You will learn how easy it is to create such a remarkably useful service with hardly three hundred lines of flask, docker and some glue-code, a project for a rainy Sunday. ----- Continuous Delivery, DevOps, Lean - all those movements have one thing in common: extending the process of software development along the whole value stream, ultimately to the customer. This simple requirement causes surprising serious difficulties on traditional operations workflows. All of a sudden, a single manual ticket to the operations team is a critical blocker in the delivery process. Therefore all parts of the infrastructure, storage, databases, identities, compute resources must be provided as a self service for the developers in order to be able to achieve this goal. What one may call "the cloud" (including self hosted ones like open stack) is such a successful model not least because they offer exactly this "ticket- less" self-service. But why should we wait for "the cloud" to offer what we really need? We are python developers, we are hackers! In this talk I will show how to build your own infrastructure- as-a-service on the example of "Postgraas", an open source postgres- as-a-service I wrote in python just for fun. With a simple curl request you can get your very own database, just like RDS on AWS. You will learn how easy it is to create such a remarkably useful service with hardly three hundred lines of flask, docker and some glue-code, a project for a rainy Sunday. After the talk you will know how to amaze your colleagues by eliminating an annoying ticket or manual workflow with a simple flask app and some creativity.

Ähnliche Filme