<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>log</title>
        <link>https://velog.io/</link>
        <description></description>
        <lastBuildDate>Thu, 10 Aug 2023 00:27:35 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>log</title>
            <url>https://images.velog.io/images/no-brand/profile/ad03483b-6112-413f-9e57-91f942c3a56b/4F662AE1-B351-40B2-BC6D-33AAE2F0BA1D.png</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/no-brand" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[Kubeflow Pipeline 문서 읽기 | 첫 파이프라인 생성하기]]></title>
            <link>https://velog.io/@no-brand/Kubeflow-Pipeline-%EB%AC%B8%EC%84%9C-%EC%9D%BD%EA%B8%B0-%EC%B2%AB-%ED%8C%8C%EC%9D%B4%ED%94%84%EB%9D%BC%EC%9D%B8-%EC%83%9D%EC%84%B1%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@no-brand/Kubeflow-Pipeline-%EB%AC%B8%EC%84%9C-%EC%9D%BD%EA%B8%B0-%EC%B2%AB-%ED%8C%8C%EC%9D%B4%ED%94%84%EB%9D%BC%EC%9D%B8-%EC%83%9D%EC%84%B1%ED%95%98%EA%B8%B0</guid>
            <pubDate>Thu, 10 Aug 2023 00:27:35 GMT</pubDate>
            <description><![CDATA[<h2 id="hello-world-kubeflow-pipeline">Hello World Kubeflow Pipeline</h2>
<h3 id="첫-파이프라인-생성하기">첫 파이프라인 생성하기</h3>
<ul>
<li><strong>Requirements</strong>
파이프라인 코드를 작성하기 위해서는 kfp 라이브러리 설치가 필요합니다.<pre><code class="language-bash">$ pip install kfp --pre</code></pre>
</li>
</ul>
<br>

<ul>
<li><p><strong>파이프라인 DSL 작성</strong>
일반 python 함수를 decorator를 이용해서 손쉽게 dsl component, dsl pipeline 으로 변경할 수 있습니다.</p>
<pre><code class="language-python">from kfp import dsl

@dsl.component
def say_hello(name: str) -&gt; str:
   hello_text = f&#39;Hello, {name}!&#39;
   print(hello_text)
   return hello_text

@dsl.pipeline
def hello_pipeline(recipient: str) -&gt; str:
   hello_task = say_hello(name=recipient)
   return hello_task.output</code></pre>
</li>
</ul>
<br>

<ul>
<li><p><strong>파이프라인 DSL 컴파일</strong>
KFP SDK Compiler 이용하면 DSL(domain-specific language) 객체를 self-contained 파이프라인 YAML 파일로 변환할 수 있습니다.</p>
<ul>
<li>Q. self-contained 란?<pre><code class="language-python">from kfp import compiler
</code></pre>
</li>
</ul>
<p>compiler.Compiler().compile(hello_pipeline, &#39;pipeline.yaml&#39;)</p>
<pre><code></code></pre></li>
</ul>
<br>

<ul>
<li><p><strong>파이프라인 실행</strong>
실행을 위해서 KFP 가 설치된 백엔드에 YAML 파일을 제출할 수 있습니다. KFP 백엔드의 deployment endpoint 를 이용합니다. 이때는 KFP SDK Client 를 이용하고, Argument 를 받도록 처리된 부분들은 다 채우도록 합니다.
수행하면, 파이프라인 Execution Graph, Log 등을 확인할 수 있는 UI 링크를 제공합니다.</p>
<pre><code class="language-python">from kfp.client import Client

client = Client(host=&#39;&lt;MY-KFP-ENDPOINT&gt;&#39;)
run = client.create_run_from_pipeline_package(
   &#39;pipeline.yaml&#39;,
   arguments={
       &#39;recipient&#39;: &#39;World&#39;,
   },
)</code></pre>
</li>
</ul>
<br>

<h3 id="reference">Reference</h3>
<ul>
<li><a href="https://v1-7-branch.kubeflow.org/docs/components/pipelines/v2/hello-world/">https://v1-7-branch.kubeflow.org/docs/components/pipelines/v2/hello-world/</a></li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[디자인패턴] SOLID | DIP (Dependency Inversion Principal), 의존성 역전 원칙]]></title>
            <link>https://velog.io/@no-brand/%EB%94%94%EC%9E%90%EC%9D%B8%ED%8C%A8%ED%84%B4-SOLID-DIP-Dependency-Inversion-Principal-%EC%9D%98%EC%A1%B4%EC%84%B1-%EC%97%AD%EC%A0%84-%EC%9B%90%EC%B9%99</link>
            <guid>https://velog.io/@no-brand/%EB%94%94%EC%9E%90%EC%9D%B8%ED%8C%A8%ED%84%B4-SOLID-DIP-Dependency-Inversion-Principal-%EC%9D%98%EC%A1%B4%EC%84%B1-%EC%97%AD%EC%A0%84-%EC%9B%90%EC%B9%99</guid>
            <pubDate>Tue, 11 Jan 2022 14:51:31 GMT</pubDate>
            <description><![CDATA[<h3 id="dip-의존성-역전-원칙">DIP, 의존성 역전 원칙</h3>
<ol>
<li>목적 : 유연셩이 극대화된 시스템</li>
<li>설명 : 의존성이 구현 (implementation) 에 의존하지 않고, 추상 (abstraction, interface) 에 의존하는 형태</li>
</ol>
<blockquote>
<p>DIP 의 아이디어 자체만 보면 비현실적 입니다. 
대부분의 언어가 concrete object 를 생성하기 위해서는 직접적인 의존성이 필요하기 때문입니다.
여기서, 의존하지 않는 대상을 &lt;변동성이 큰 구체적인 요소&gt; 로 보는게 맞습니다.</p>
<p>(예) 기본타입 (String), 운영체제, 플랫폼 등은 안정성이 보장된 항목이니 의존을 허용합니다.</p>
</blockquote>
<h3 id="팩토리-예제">팩토리 예제</h3>
<p>변동성이 큰 구체 객체를 생성할 때 주의해야 합니다. 객체를 생성하려면 기 정의된 구체 클래스에 대해서 소스코드 의존성이 발생하기 때문입니다.
하단의 Abstract Factory 패턴의 경우, 생성을 위한 인터페이스를 두면서 소스코드의 의존성이 모두 한 방향을 (추상적인 쪽으로) 향하도록 만들 수 있습니다.
구체 컴포넌트에 DIP 를 위반하는 구간이 있지만, 모두 없을 수는 없는 필수적인 요소로 볼 수 있습니다. 단, DIP 를 위반하는 클래스를 하나의 구체 컴포넌트에 모아둘 수 있어서 나쁘지 않은 선택입니다.</p>
<p><img src="https://images.velog.io/images/no-brand/post/36c62886-e975-4cfb-8ac2-ff71b26fdd2f/967BE606-5F64-4AC1-9232-5EA78A3ABD59.jpeg" alt=""></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[Spring] AOP | AspectJ pointcut expression]]></title>
            <link>https://velog.io/@no-brand/spring-aop-aspectj-pointcut-expression</link>
            <guid>https://velog.io/@no-brand/spring-aop-aspectj-pointcut-expression</guid>
            <pubDate>Tue, 21 Dec 2021 14:14:22 GMT</pubDate>
            <description><![CDATA[<h2 id="표현식">표현식</h2>
<pre><code class="language-java">execution(* com.nobrand.calculator.ArithmeticCalculator.*(..))</code></pre>
<ul>
<li>앞쪽의 와일드카드 (*) 는 modifier (public, protected, private) 와 리턴타입에 상관없음을 의미</li>
<li>클래스명 뒤의 와일드카드는 함수명에 상관없음을 의미</li>
<li>(..) 두 점은 함수의 파라미터 개수에 관계없음을 의미</li>
</ul>
<pre><code class="language-java">// modifier (public)
execution(public * com.nobrand.calculator.ArithmeticCalculator.*(..))

// 리턴타입 (double)
execution(public double com.nobrand.calculator.ArithmeticCalculator.*(..))

// 메소드 파라미터 (첫 번째 double 타입, 뒤는 몇 개라도 상관 없음)
execution(public double com.nobrand.calculator.ArithmeticCalculator.*(double, ..))

// 메소드 파라미터 (첫 번째, 두 번째 double 타입)
execution(public double com.nobrand.calculator.ArithmeticCalculator.*(double, double))</code></pre>
<h2 id="annotation-활용법">Annotation 활용법</h2>
<pre><code class="language-java">// annotation 정의
@Target(ElementType.METHOD, ElementType.TYPE)
@Retenion(RetentionPolicy.RUNTIME)
@Documented
public @interface Logging { }

// annotation 을 이용한 pointcut (조건)
@Aspect
public class CustomPointcuts {

    @Pointcut(“annotation(com.nobrand.Logging)”)
    public void loggingOperation() { }

}
</code></pre>
<p>필요한 메소드에 커스텀 애너테이션 (@Logging) 을 붙이고, Pointcut (조건) 은 해당 애너테이션을 체크합니다. </p>
<h2 id="reference">Reference</h2>
<p>[1] <a href="https://www.eclipse.org/aspectj">AspectJ</a></p>
]]></description>
        </item>
    </channel>
</rss>