<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Dev-Ops on man.hwangsehyun.com</title>
    <link>https://man.hwangsehyun.com/tags/dev-ops/</link>
    <description>Recent content in Dev-Ops on man.hwangsehyun.com</description>
    <image>
      <title>man.hwangsehyun.com</title>
      <url>https://man.hwangsehyun.com/images/papermod-cover.png</url>
      <link>https://man.hwangsehyun.com/images/papermod-cover.png</link>
    </image>
    <generator>Hugo -- 0.145.0</generator>
    <language>kr</language>
    <lastBuildDate>Thu, 19 Sep 2024 00:00:00 +0900</lastBuildDate>
    <atom:link href="https://man.hwangsehyun.com/tags/dev-ops/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Basic LLM Ops in AWS</title>
      <link>https://man.hwangsehyun.com/posts/llm-ops-in-aws/</link>
      <pubDate>Thu, 19 Sep 2024 00:00:00 +0900</pubDate>
      <guid>https://man.hwangsehyun.com/posts/llm-ops-in-aws/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;
&lt;p&gt;
  &lt;img
    loading=&#34;lazy&#34;
    src=&#34;https://upload.wikimedia.org/wikipedia/commons/8/82/Las_Vegas_slot_machines.jpg&#34;
    alt=&#34;Row of digital-based slot machines inside a casino in Las Vegas&#34;
    
  /&gt;







&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Row of digital-based slot machines inside a casino in Las Vegas: &lt;a
  href=&#34;https://en.wikipedia.org/wiki/Slot_machine#/media/File:Las_Vegas_slot_machines.jpg&#34;
  &gt;Source&lt;/a
&gt;
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;a
  href=&#34;https://arxiv.org/abs/2409.05746&#34;
  &gt;LLMs Will Always Hallucinate, and We Need to Live With This&lt;/a
&gt;
. 프롬프트에 수정이 필요할 때, 비관적인 관점에서는 LLM은 슬롯 머신과 같아서 &lt;a
  href=&#34;https://en.wikipedia.org/wiki/Balloon_effect&#34;
  &gt;풍선 효과&lt;/a
&gt;
를 피할 수 없다. 운이 좋으면 안 되던 것이 될 수도 있겠지만, 되던 것이 안 되던 경우도 비일비재했으며, 자연어를 출력하는 LLM의 특성 상 결국 테스트셋 전체를 LLM에 넣어보고 출력을 사람이 검토하는 작업을 정기적으로 수행했다. Batch job을 수행하고 비개발자와 결과를 검토하는 과정에서 개발자들은 엑셀을 읽고 쓰는 일회용 파이썬 코드를 (무수히 많이) 혼자서만 쓰고 폐기했으며, 이 코드는 서비스에서 돌아가는 코드와 입출력이 달라 테스트 결과도 신뢰할 수 없었다. Batch testing은 통과했으나 실제 서비스에서는 체감 성능이 다른 고통스런 경험을 수도 없이 반복하며, 이 비효율을 발본색원할 수 있는 시스템을 AWS 서비스들과 &lt;a
  href=&#34;https://opentelemetry.io/&#34;
  &gt;&lt;em&gt;OpenTelemetry&lt;/em&gt;&lt;/a
&gt;
를 이용해 구축하고 있다.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Operations: Dev, Building, Testing, CI/CD, and more...</title>
      <link>https://man.hwangsehyun.com/tech/operations/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://man.hwangsehyun.com/tech/operations/</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;개발 팀이 편안한 환경에서 장기적인 성과를 낼 수 있도록 노력해왔습니다.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;development&#34;&gt;Development&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;가장 코드 양이 많은 JavaScript, Python을 중심으로 Convention 확립에 노력했습니다.&lt;/li&gt;
&lt;li&gt;JavaScript, TypeScript Node.js 프로젝트에 전역적으로 적용할 수 있는 &lt;a
  href=&#34;https://eslint.org/docs/latest/extend/shareable-configs&#34;
  &gt;ESLint Sharable Config&lt;/a
&gt;
를 &lt;a
  href=&#34;https://github.com/sehyun-hwang/eslint-config-nextlab&#34;
  &gt;https://github.com/sehyun-hwang/eslint-config-nextlab&lt;/a
&gt;
에서 오픈소스로 관리하고 있습니다.&lt;/li&gt;
&lt;li&gt;Python에서는 Type checking과 Linting을 동시에 구동하기 위해서 mypy를 Child process로 실행하는 pylint plugin을 제작한 적이 있으며, 최근에는 ruff linter와 black formatter를 사용하고 있습니다.&lt;/li&gt;
&lt;li&gt;다양한 언어로 이루어진 Monorepo에 대한 Convention을 관리하기 위해서 &lt;a
  href=&#34;https://megalinter.io/latest/&#34;
  &gt;MegaLinter&lt;/a
&gt;
와 그것의 &lt;a
  href=&#34;https://github.com/marketplace/actions/megalinter&#34;
  &gt;Github Action&lt;/a
&gt;
을 도입했습니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;building&#34;&gt;Building&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;이미지 처리 등의 특수한 기능이 있는 컨테이너들에 대해서는 불필요한 컴파일러와 인터프리터를 제거하는 &lt;a
  href=&#34;https://docs.docker.com/build/building/multi-stage/&#34;
  &gt;Multi-stage build&lt;/a
&gt;
를 수행했습니다.&lt;/li&gt;
&lt;li&gt;alpine 기반의 컨테이너로 컨테이너의 이미지 크기를 줄여 빌드 시간 단축, 배포 속도 개선, 취약점 개선 등의 효과를 얻었습니다.&lt;/li&gt;
&lt;li&gt;복수의 Dockerfile을 이용한 Container build, 빌드 캐시 관리 등 High-level build 기능을 구현해주는 &lt;a
  href=&#34;https://docs.docker.com/build/bake/&#34;
  &gt;&lt;code&gt;buildx bake&lt;/code&gt;&lt;/a
&gt;
를 도입했습니다.&lt;/li&gt;
&lt;li&gt;Makefile을 이용해 직접 별도로 컴파일해야 하는 C++ 프로젝트나 표준적이지 않은 프로젝트의 개발-빌드-테스트-배포 과정을 관리합니다.&lt;/li&gt;
&lt;li&gt;빌드를 위한 인프라를 관리할 필요가 없고 동시에 작업을 병렬적으로 진행할 수 있는 Serverless CI를 추구합니다.
&lt;ul&gt;
&lt;li&gt;AWS CodeBuild&lt;/li&gt;
&lt;li&gt;GitHub Action&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;testing&#34;&gt;Testing&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Test runner가 테스트 케이스들을 병렬적으로 수행하는 데 문제가 없도록 하는 정석적인 객체 지향 코드를 작성합니다. 서비스 코드에 Side effect가 없고 부분 별로 역할 구분이 명확해야 테스트 코드에서 class를 상속받아서 테스트 케이스를 작성할 수 있었습니다.&lt;/li&gt;
&lt;li&gt;&lt;a
  href=&#34;https://vitest.dev/&#34;
  &gt;vitest&lt;/a
&gt;
, &lt;a
  href=&#34;https://docs.pytest.org/en/stable/&#34;
  &gt;pytest&lt;/a
&gt;
로 테스트 케이스를 작성할 수 있습니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;!--stackedit_data:
eyJoaXN0b3J5IjpbLTE5ODkxMTU4NDUsNzQ3Njg3NTc3LC0xMz
AzMDYxODAxLC0xOTMyNjY2MDg0LC0xNTc3MDgyMjE5LC03MDIz
MTU0MDksMTY0OTUxNTQ0NiwtMjA3NDg5NTI0NCwxNTcwMDcxND
A5LDg3NDc4Mzk2NywtMTk5ODE4MzY1MCwtMTY5NjU2Mzc1OCwx
MTExNTQ2ODI1LDEyMzUxODU2NDgsLTE2MDA0NjU1MjMsMTIzNT
E4NTY0OCwxODUzOTE3MjQ5LDk2MTIxNDYyMywtOTI1OTUwMDcx
LDczMDk5ODExNl19
--&gt;</description>
    </item>
    <item>
      <title>Security Routines</title>
      <link>https://man.hwangsehyun.com/tech/security/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://man.hwangsehyun.com/tech/security/</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;어떻게 보면 당연한 관습들을 풀어서 글로 남겼습니다.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;routines&#34;&gt;Routines&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a
  href=&#34;https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html&#34;
  &gt;&lt;strong&gt;IAM&lt;/strong&gt;&lt;/a
&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Production 환경에서는 &lt;a
  href=&#34;https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html&#34;
  &gt;Lambda execution role&lt;/a
&gt;
과 &lt;a
  href=&#34;https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html&#34;
  &gt;EC2 IAM role&lt;/a
&gt;
 등의 &lt;a
  href=&#34;https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html&#34;
  &gt;IAM temporary credential&lt;/a
&gt;
 기능을 활용합니다.&lt;/li&gt;
&lt;li&gt;리소스에게 부여된 권한들은 해당 리소스의 동작에 대한 명세이기도 하다고 생각하고 있으며, Service role에 Least privilege rule을 최대한 준수했습니다.&lt;/li&gt;
&lt;li&gt;프로젝트 별로 User group을 만들고 개발자들에게 개발에 필요한 권한을 부여합니다.&lt;/li&gt;
&lt;li&gt;&lt;a
  href=&#34;https://cli.github.com/manual/gh_auth_login&#34;
  &gt;GitHub CLI SSO&lt;/a
&gt;
, &lt;a
  href=&#34;https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html&#34;
  &gt;AWS CLI SSO&lt;/a
&gt;
 등의 SSO 서비스를 사용해 개발자가 개발에 필요한 권한을 획득할 수 있도록 도입 중입니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Secrets Management&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
