4
4

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.

CircleCIのスペックを上げたい

Posted at

はじめに

CircleCIでコンテナのスペックを上げるには、resource_classを指定する必要があります。

本記事は、このresource_classの簡単な解説です。

環境

CircleCI 2.1

resource_classとは

ジョブのコンテナに割り当てるCPUの数とメモリ容量の組み合わせを、以下のクラスから指定することができます。

クラス 仮想CPU数 メモリ容量
small 1 2GB
medium 2 4GB
medium+ 3 6GB
large 4 8GB
xlarge 8 16GB

(公式を見ると、さらに上のクラスも存在する様子)

resource_classを使うには

CircleCIのconfig.ymlで、以下のように指定します(Version 2.1である必要もあります)。

.circleci/config.yml
version: 2.1
jobs:
  build:
    docker:
      - image: circleci/php:7.4-node-browsers-legacy
    resource_class: medium+ # ここで指定
    working_directory: ~/laravel

ただし、この機能を使うには、有償のPerformance Plan以上を契約した上で、サポートに依頼して有効化してもらう必要があります。

有効化を行わないまま、CircleCIを実行すると、CircleCIの画面上に以下のような警告が出ます。

warinig

Resource class medium+ for docker is not available for your project. This message will often appear if the pricing plan for this project does not support medium+ use. Default class medium will be used. Please contact your CSM person or our support team to whitelist your project.

Dockerのリソースクラスmedium +は、プロジェクトでは使用できません。このメッセージは、このプロジェクトの価格プランが中程度以上の使用をサポートしていない場合によく表示されます。デフォルトのクラス媒体が使用されます。 CSM担当者またはサポートチームに連絡して、プロジェクトをホワイトリストに登録してください。

サンプルのconfig.ymlではmedium+を指定しましたが、機能が有効でないと、

  • Default class medium will be used.

とある通り、デフォルトであるmediumが使用されます。

サポートには以下から問い合わせ可能です。

参考

4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?