1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rocket で aobench を動かす.

Posted at

アプリケーションコンテナイメージ&実行環境である Rocket を使って, どこでも aobench を動かしたいですね!
さっそくやってみましょう.
(本稿は rocket v0.1.1 を使っています)

rocket 化した aobench コードはこちら.

actool をビルドする.

パッケージャ(?)である actool をビルドします.

$ git clone https://github.com/appc/spec
$ cd spec
$ ./build

bin/actool が出来ているのを確認します. actool を使ってパッケージ(aci)を作ります.

spec のページを参考にバイナリやらをレイアウトします. 今回はカレントディレクトリに img/ をつくり, そこに一式入れました.

また, 現状 dynamic link 形式のバイナリはそのままでは実行できないので注意が必要です. 可能であれば static link にしておきます.

$ actool build img aobench.aci

rkt は http or https しかサポートしていないため, .aci を適当な web サーバに上げて http(s) 経由で取得できるようにします.

$ ./rtk run https://github.com/syoyo/aobench-rocket/blob/master/aobench.aci?raw=true
Timezone UTC does not exist in container, not updating container timezone.
Output ao.ppm
Sending SIGTERM to remaining processes...
Sending SIGKILL to remaining processes...
Unmounting file systems.
Unmounting /proc/sys/kernel/random/boot_id.
All filesystems unmounted.
Halting system.

Cool!

(rtk は実行時に systemd を使っているので, systemd な環境でないと動きません. 今回 rkt 実行側は CoreOS を使いました).

TODO

  • dynamic link 形式のアプリも動かせるようにする(C/C++ だとこちらのほうが通常の形式)
  • URL が同じだとデータがキャッシングされてしまうので, イメージをアップデートしたら別の URL にするか, キャッシュを削除するしくみが必要(rkt には削除コマンドはまだない?)
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?