Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Open Feature 面白いぞ
Search
SatohJohn
February 19, 2025
Programming
0
39
Open Feature 面白いぞ
Jagu'e'r Cloud Native ハイブリッド Meetup# 17 の 5分LT の発表の内容です
SatohJohn
February 19, 2025
Tweet
Share
More Decks by SatohJohn
See All by SatohJohn
Workforce Identity を使った 権限管理で Cloud Run を動かしてみた
satohjohn
0
290
Gemini + Vertex AI を使って作業を自動化「していく」
satohjohn
0
69
Cloud_Run_GPU___Gemma_2_を使った_LLM_アプリケーション開発のススメ.pdf
satohjohn
0
25
Firebase Authenticationのセッション管理術
satohjohn
2
2.3k
お客様とすすめる_フロントエンドの技術支援.pdf
satohjohn
1
1.1k
コンテナ環境のKotlinアプリケーション を運用しよう _ Google Cloudを使って
satohjohn
0
170
GCPでのバッチ処理パターンを考えてみる
satohjohn
1
1.2k
GCPと連携してマスターデータ更新
satohjohn
0
210
Nuxt.js + Google App Engine でのアプリケーション開発の勘所
satohjohn
0
470
Other Decks in Programming
See All in Programming
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
350
いまさら聞けない生成AI入門: 「生成AIを高速キャッチアップ」
soh9834
12
3.9k
エンジニア未経験が最短で戦力になるためのTips
gokana
0
220
英語文法から学ぶ、クリーンな設計の秘訣
newnomad
1
270
アプリを起動せずにアプリを開発して品質と生産性を上げる
ishkawa
0
650
Django for Data Science (Boston Python Meetup, March 2025)
wsvincent
0
260
CRE Meetup!ユーザー信頼性を支えるエンジニアリング実践例の発表資料です
tmnb
0
440
PsySHから紐解くREPLの仕組み
muno92
PRO
1
530
MCP世界への招待: AIエンジニアが創る次世代エージェント連携の世界
gunta
2
690
‘무차별 LGTM~👍’만 외치던 우리가 ‘고봉밥 코드 리뷰’를?
hannah0731
0
540
PHPUnit 高速化テクニック / PHPUnit Speedup Techniques
pinkumohikan
1
1.2k
AIコードエディタの基盤となるLLMのFlutter性能評価
alquist4121
0
140
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
480
Agile that works and the tools we love
rasmusluckow
328
21k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
500
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Speed Design
sergeychernyshev
28
870
Visualization
eitanlees
146
16k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
28
1.6k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
135
33k
Done Done
chrislema
183
16k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
30
1.1k
Transcript
Open Feature面白いぞ Jagu'e'r Cloud Native ハイブリッド Meetup# 17 株式会社スリーシェイク 佐藤慧太
Copyright © 3-shake, Inc. All Rights Reserved.
自己紹介 佐藤 慧太@SatohJohn • 2012/4 フリュー株式会社 入社 ToC 向けのアプリケーション開発を 10年ほど経験
リードエンジニアとして 0からサービスを 設計開発運用を経験 • 2023/1 株式会社スリーシェイク 入社 SRE として労苦 <Toil>を減らす仕事に従事 Google Cloud Partner Top Engineer ’24、’25 生成 AI とかやってます
What’s Open Feature 01 Copyright © 3-shake, Inc. All Rights
Reserved.
そもそも Feature Flag について 1. Trunk ベース開発など高速なリリースにおける痛みを和らげる a. AB テスト、カナリアテストのように切り替える
b. kill スイッチのように特定の機能を無効化する c. チェックができておらずマージできない など 2. Permission のようなパラメータ管理 https://speakerdeck.com/biwashi/cloudnative-days-summer-2024-declarative-aggregated-management-of -feature-flags-using-openfeature-and-auto-generation OpenFeatureと自動生成を活用したフィーチャーフラグの宣言的集約管理
Open Feature について 1. ベンダー中立性 a. Provider で抽象化(ConfigCat、など) 2. Feature
Flag について標準化 a. Spec をまとめて新しい Provider の作成に役立てる 3. 様々な言語での実装 https://openfeature.dev/
HotoUse(Flag Evaluation) 1. Flagd Provider 2. Node.js services: server: build:
./app environment: NODE_ENV: production FLAGD_HOST: flagd PORT: 3333 ports: - 3333:3333 flagd: image: ghcr.io/open-feature/flagd:latest volumes: - type: bind source: ./flagd/flags.flagd.json target: /etc/flagd/flags.flagd.json ports: - 8013:8013 command: ["start", "--uri", "file:/etc/flagd/flags.flagd.json"]
HotoUse(Flag Evaluation) 1. Flagd Provider 2. Node.js { "flags": {
"welcome-message": { "variants": { "on": true, "off": false }, "state": "ENABLED", "defaultVariant": "on" } } } • Flagd がファイルを watch し続けているのでdefault value を変更すると アプリケーションでも変更が伝わる • Variants に無いものを設定するとエラーになるがアプリケーション側では 前回の値になっている • このあたりのエラー状態については、 https://openfeature.dev/specification/sections/events#requirement-535 https://flagd.dev/reference/monitoring/
HotoUse(Flag Evaluation) 1. Flagd Provider 2. Node.js import express from
"express"; import Router from "express-promise-router"; import { OpenFeature } from "@openfeature/server-sdk"; import { FlagdProvider } from "@openfeature/flagd-provider"; OpenFeature.setProvider(new FlagdProvider({ host: process.env.FLAGD_HOST || "localhost" })); const client = OpenFeature.getClient(); const app = express(); const routes = Router(); app.use((_, res, next) => { res.setHeader("content-type", "text/plain"); next(); }, routes); routes.get("/", async (_, res) => { const showWelcomeMessage = await client.getBooleanValue( "welcome-message", false ); if (showWelcomeMessage) { res.send("Express + TypeScript + OpenFeature Server"); } else { res.send("Express + TypeScript Server"); } }); const port = process.env.PORT || 3333; app.listen(port, () => { console.log(`Server running at http://localhost:${port}`); }); https://openfeature.dev/specification/sections/flag-eval uation/
HotoUse(GKE) apiVersion: core.openfeature.dev/v1beta1 kind: FeatureFlag metadata: name: flags labels: app:
open-feature spec: flagSpec: flags: welcome-message: state: ENABLED variants: 'on': true 'off': false defaultVariant: 'off' --- # Feature flag source custom resource, configuring flagd to source flags from FeatureFlag CRDs apiVersion: core.openfeature.dev/v1beta1 kind: FeatureFlagSource metadata: name: flag-sources labels: app: open-feature spec: sources: - source: flags provider: kubernetes 1. GKE 2. K8s operator
HotoUse(GKE) # Deployment of a app using our custom resources
apiVersion: apps/v1 kind: Deployment metadata: name: open-feature-deployment labels: app: open-feature spec: replicas: 1 selector: matchLabels: app: open-feature template: metadata: labels: app: open-feature annotations: openfeature.dev/enabled: 'true' openfeature.dev/featureflagsource: 'flag-sources' spec: containers: 1. GKE 2. K8s operator
HotoUse(Tracking) 1. Devcycle (Flagd では未実装っぽい) 2. Node.js const devcycleClient =
initializeDevCycle("id") OpenFeature.setProviderAndWait(await devcycleClient.getOpenFeatureProvider()); client.track("welcomemessage_trackingid", context); https://openfeature.dev/specification/sections/flag-eval uation/
Provider の自作 • Providerの 仕様 にしたがって メソッドを記載していくと 作れる • Firebase
Remote Config 周りで挑戦してみても 良いかもしれない https://openfeature.dev/specification/ class MyProvider implements Provider { readonly hooks: Hook[] = [new MyProviderHook()]; void initialize(EvaluationContext initialContext) { /* A hypothetical initialization function: make an initial call doing some bulk initial evaluation, start a worker to do periodic updates */ this.flagCache = this.restClient.bulkEvaluate(initialContext); this.startPolling(); } getProviderHooks(): Hook[] { return [new MyProviderHook()]; } void dispose() { // close connections, terminate threads or timers, etc... } /** * Record a tracking event. */ void track(String trackingEventName, EvaluationContext context, TrackingEventDetails details): void; }
まとめ 1. Feature Flag を使っているプロジェクトであれば使っていくのは良さそう a. いろんなプロジェクトがあって困るみたいなときに良さそう b. ちょっと Provider
作れないかなーという感じ 2. Tracking がサポートされている Provider が少ないので作って! 作るかー!
Thank you Copyright © 3-shake, Inc. All Rights Reserved.