rocket-a

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
fn [2026/01/20 12:18] rootfn [2026/01/26 16:11] (現在) root
行 1: 行 1:
 +■OCI Funtion  構築
 +Administrators
 +アプリケーション詳細 ローカル設定ーガイドの表示から設定方法を確認してください。
 +[repo-name-prefix]=rocketa
 +token
 +<code>
 +[s2<PkXJ)dpwrd;ACqAC
 +</code>
 +本番ログ確認
 +<code>
 +oci logging-search search-logs  --search-query 'search "ocid1.loggroup.oc1.ap-tokyo-1.amaaaaaakhrc57yaxccnkoom7xqneg7svgkoihmgnwlkba365xfcivvq2y2a" | sort by datetime desc | limit 50'  --time-start 2026-01-26T05:00:00Z --time-end   2026-01-26T06:00:00Z
 +</code>
 Contextの中にapp、appの中functonがあるイメージ Contextの中にapp、appの中functonがあるイメージ
 http実行するとき、Service の中に Trigger, Trigger,の中に → Functionがあるイメージ http実行するとき、Service の中に Trigger, Trigger,の中に → Functionがあるイメージ
行 6: 行 18:
 fn create context context_name fn create context context_name
 fn use context context_name fn use context context_name
 +</code>
 +<code>
 +fn delete context context_name
 </code> </code>
  
行 14: 行 29:
  
 ■関数 ■関数
 +基本的にディレクトリ内で、デプロイまでの操作をした方がよい。
 <code> <code>
 mkdir test mkdir test
行 35: 行 51:
 <code> <code>
 fn deploy --app app_name fn deploy --app app_name
 +</code>
 +対象のfnディレクトリ内ではこれで問題ないっぽい
 +service --local  ローカル環境でxontextの中にapp、appの中functonがあるイメージ
 +http実行するとき、Service の中に Trigger, Trigger,の中に → Functionがあるイメージ
 +■context 
 +通常デフォルトがあるのでやらなくてよい。
 +<code>
 +fn create context context_name
 +fn use context context_name
 </code> </code>
  
 +■アプリ
 +<code>
 +fn create app app_name 
 +</code>
 +
 +■関数
 +<code>
 +mkdir test
 +cd test
 +fn init --runtime python --name fn_name app_name
 +</code>
 +これで問題ないっぽい
 +<code>
 +fn init --runtime python fn_name
 +</code>
 +同一階層でローカル実行
 +<code>
 +fn run
 +</code>
 +JSON引数付き
 +<code>
 +echo '{"name":"python"}' | fn run
 +</code>
 +
 +■デプロイ
 +<code>
 +fn deploy --app app_name
 +</code>
 +対象のfnディレクトリ内ではこれで問題ないっぽい
 +service --local  ローカル環境で実行する場合
 +<code>
 +fn deploy --app service --local
 +</code>
 ■App内のfunction一覧 ■App内のfunction一覧
 <code> <code>
行 43: 行 101:
  
 ■trigger ■trigger
-fn create trigger service service_name test2 --type http --source /test2+service_nameを独自作成する方法はない、trigger作成時に作成しないといけない。あまり意味がない。これでWebから実行可能 
 +<code> 
 +fn create trigger service service_name  trigger_name --type http --source /path_name 
 +</code> 
 +fn create trigger service log log --type http --source /log 
  
 ■requirements.txt ■requirements.txt
行 58: 行 121:
 pm2 log 0 |  sed 's/\\n/\n/g' pm2 log 0 |  sed 's/\\n/\n/g'
 </code> </code>
 +
 +
 +■スニペット
 +fn start
 +pm2 start "fn start --log-level DEBUG --port 8080" --name fnserve
 +fn list contexts
 +fn version
 +fn list contexts
 +fn build
 +fn deploy --app service --local
 +fn create trigger service click click --type http --source /click
 +fn list trigger service
 +
 +r
 +
 +
fn.1768879133.txt.gz · 最終更新: by root