<h1>About the series</h1><p>CICD (Continuous Improvement and Continuous Delivery) is a acronym used in DevOps recently. CICD pipeline is an automation for CI and CD practices from git push to application deployment. The series explains end-to-end system settings on CICD using one demo application (<a href="https://github.com/Tak113/streamlit_ef_mc" target="_blank">git repo</a>). This articles assume user have a knowledge of github(<a href="https://datak.biz/blog/detail/7/" target="_blank">Github Basics</a>) and docker.</p><ol><li>Part1 : CICD basics and Docker settings using streamlit app</li><li>Part2 : CICD script/pipeline using travis and AWS elastic beanstalk</li><li>Part3 : Automation demo and Sub-domain assignment : AWS EB, Git IO, and Firebase using google domain</li></ol><h2>What is Continuous Integration (CI) ?</h2><p>Continuous Integration is commonly understood as a development effort for regularly integrating code into a branch in a git. This is to avoid traditional problem of 'merge day' from projects split to each project team members, which frequently messed up in a entire view.</p><h2>What is Continuous Delivery (CD) ?</h2><p>Continuous delivery packages up the code into a deliverable unit that can then be deployed by the developers themselves or by a separate operations team if necessary. This technical definition, though, is not much intended when we use CICD in a DevOps context. CD is meaning more common like 'Continuous Deployment' which refers to a process that automatically deploys changes to production.</p><p><br></p><h2>Dockerfile set up</h2><p>Assuming you have web application locally ready. Then create dockerfile right under project directly.</p><pre># shell script cd <project directly></pre><p>Make sure that you use virtual environment and list up dependencies</p><pre># shell script pip freeze > requirements.txt</pre><p>Create Dockerfile.</p><pre># shell script vim Dockerfile</pre><p>Dockerfile includes following scripts.</p><pre># Dockerfile #fetch base image FROM python:3.8-slim-buster #change working directory to /usr/app WORKDIR ./usr/app #copy requirement.txt to /usr/app in docker COPY requirement.txt ./ #install dependency '-r' means 'force' RUN pip install -r requirements.txt #specify port for streamtlit. default for streamlit is 8501 EXPOSE 8501 #copy remaining application contents of the pp into a docker directory. split COPY will speed up as `pip install requirements.txt` takes most of time and we would not like to re-run the code every time the app code is edited COPY ./ ./ #execution command when container starts CMD ["streamlit", "run", "app.py(or starter python file)"]</pre><p><br></p><h2>Docker Test</h2><p>Before integrate into CICD script, test docker module level to see if the application works correctly in a container</p><pre># shell script cd <project directly> docker build -t <docker name>/<docker repo name> . docker run -p 8501:8501 <docker name>/<docker repo name></pre><p><br></p><p><br></p><p><br></p>
<< Back to Blog Posts
Back to Home