config.yml 12.1 KB
Newer Older
1
2
version: 2.1

3
# How to test the Linux jobs:
4
#   - Install CircleCI local CLI: https://circleci.com/docs/2.0/local-cli/
Edward Z. Yang's avatar
Edward Z. Yang committed
5
6
7
#   - circleci config process .circleci/config.yml > gen.yml && circleci local execute -c gen.yml --job binary_linux_wheel_py3.7
#     - Replace binary_linux_wheel_py3.7 with the name of the job you want to test.
#       Job names are 'name:' key.
8

9
10
binary_common: &binary_common
  parameters:
Edward Z. Yang's avatar
Edward Z. Yang committed
11
    # Edit these defaults to do a release
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
    build_version:
      description: "version number of release binary; by default, build a nightly"
      type: string
      default: ""
    pytorch_version:
      description: "PyTorch version to build against; by default, use a nightly"
      type: string
      default: ""
    # Don't edit these
    python_version:
      description: "Python version to build against (e.g., 3.7)"
      type: string
    unicode_abi:
      description: "Python 2.7 wheel only: whether or not we are cp27mu (default: no)"
      type: string
      default: ""
  environment:
    PYTHON_VERSION: << parameters.python_version >>
    BUILD_VERSION: << parameters.build_version >>
    PYTORCH_VERSION: << parameters.pytorch_version >>
    UNICODE_ABI: << parameters.unicode_abi >>
Edward Z. Yang's avatar
Edward Z. Yang committed
33
    CU_VERSION: cpu
34
35

jobs:
36
37
38
39
40
41
42
43
44
45
46
  circleci_consistency:
    docker:
      - image: circleci/python:3.7
    steps:
      - checkout
      - run:
          command: |
            pip install --user --progress-bar off jinja2
            python .circleci/regenerate.py
            git diff --exit-code || (echo ".circleci/config.yml not in sync with config.yml.in! Run .circleci/regenerate.py to update config"; exit 1)

47
  binary_linux_wheel:
48
    <<: *binary_common
49
50
51
52
53
    docker:
      - image: "soumith/manylinux-cuda100"
    resource_class: 2xlarge+
    steps:
      - checkout
54
      - run: packaging/build_wheel.sh
55
      - store_artifacts:
56
          path: dist
Edward Z. Yang's avatar
Edward Z. Yang committed
57
58
59
60
      - persist_to_workspace:
          root: dist
          paths:
            - "*"
61
62

  binary_linux_conda:
63
    <<: *binary_common
64
65
66
67
68
    docker:
      - image: "soumith/conda-cuda"
    resource_class: 2xlarge+
    steps:
      - checkout
69
      - run: packaging/build_conda.sh
70
71
      - store_artifacts:
          path: /opt/conda/conda-bld/linux-64
Edward Z. Yang's avatar
Edward Z. Yang committed
72
73
74
75
      - persist_to_workspace:
          root: /opt/conda/conda-bld/linux-64
          paths:
            - "*"
76

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
  binary_macos_wheel:
    <<: *binary_common
    macos:
      xcode: "9.0"
    steps:
      - checkout
      - run:
          # Cannot easily deduplicate this as source'ing activate
          # will set environment variables which we need to propagate
          # to build_wheel.sh
          command: |
            curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
            sh conda.sh -b
            source $HOME/miniconda3/bin/activate
            packaging/build_wheel.sh
      - store_artifacts:
          path: dist
Edward Z. Yang's avatar
Edward Z. Yang committed
94
95
96
97
      - persist_to_workspace:
          root: dist
          paths:
            - "*"
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

  binary_macos_conda:
    <<: *binary_common
    macos:
      xcode: "9.0"
    steps:
      - checkout
      - run:
          command: |
            curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
            sh conda.sh -b
            source $HOME/miniconda3/bin/activate
            conda install -yq conda-build
            packaging/build_conda.sh
      - store_artifacts:
          path: /Users/distiller/miniconda3/conda-bld/osx-64
Edward Z. Yang's avatar
Edward Z. Yang committed
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
      - persist_to_workspace:
          root: /Users/distiller/miniconda3/conda-bld/osx-64
          paths:
            - "*"

  # Requires org-member context
  binary_conda_upload:
    docker:
      - image: continuumio/miniconda
    steps:
      - attach_workspace:
          at: ~/workspace
      - run:
          command: |
            # Prevent credential from leaking
            conda install -yq anaconda-client
            set +x
            anaconda login \
                --username "$PYTORCH_BINARY_PJH5_CONDA_USERNAME" \
                --password "$PYTORCH_BINARY_PJH5_CONDA_PASSWORD"
            set -x
            anaconda upload ~/workspace/*.tar.bz2 -u pytorch-nightly --label main --no-progress --force

  # Requires org-member context
  binary_wheel_upload:
    docker:
      - image: circleci/python:3.7
    steps:
      - attach_workspace:
          at: ~/workspace
      - checkout
      - run:
          command: |
            pip install --user awscli
            export PATH="$HOME/.local/bin:$PATH"
            # Prevent credential from leaking
            set +x
            export AWS_ACCESS_KEY_ID="${PYTORCH_BINARY_AWS_ACCESS_KEY_ID}"
            export AWS_SECRET_ACCESS_KEY="${PYTORCH_BINARY_AWS_SECRET_ACCESS_KEY}"
            set -x
            for pkg in ~/workspace/*.whl; do
              aws s3 cp "$pkg" "s3://pytorch/whl/nightly/" --acl public-read
            done
157

158
159
160
workflows:
  build:
    jobs:
161
      - circleci_consistency
Edward Z. Yang's avatar
Edward Z. Yang committed
162
      
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
      - binary_linux_wheel:
          name: binary_linux_wheel_py2.7
          python_version: "2.7"
      - binary_linux_wheel:
          name: binary_linux_wheel_py2.7_unicode
          python_version: "2.7"
          unicode_abi: "1"
      - binary_linux_wheel:
          name: binary_linux_wheel_py3.5
          python_version: "3.5"
      - binary_linux_wheel:
          name: binary_linux_wheel_py3.6
          python_version: "3.6"
      - binary_linux_wheel:
          name: binary_linux_wheel_py3.7
          python_version: "3.7"
      - binary_macos_wheel:
          name: binary_macos_wheel_py2.7
          python_version: "2.7"
      - binary_macos_wheel:
          name: binary_macos_wheel_py2.7_unicode
          python_version: "2.7"
          unicode_abi: "1"
      - binary_macos_wheel:
          name: binary_macos_wheel_py3.5
          python_version: "3.5"
      - binary_macos_wheel:
          name: binary_macos_wheel_py3.6
          python_version: "3.6"
      - binary_macos_wheel:
          name: binary_macos_wheel_py3.7
          python_version: "3.7"
      - binary_linux_conda:
          name: binary_linux_conda_py2.7
          python_version: "2.7"
      - binary_linux_conda:
          name: binary_linux_conda_py3.5
          python_version: "3.5"
      - binary_linux_conda:
          name: binary_linux_conda_py3.6
          python_version: "3.6"
      - binary_linux_conda:
          name: binary_linux_conda_py3.7
          python_version: "3.7"
      - binary_macos_conda:
          name: binary_macos_conda_py2.7
          python_version: "2.7"
      - binary_macos_conda:
          name: binary_macos_conda_py3.5
          python_version: "3.5"
      - binary_macos_conda:
          name: binary_macos_conda_py3.6
          python_version: "3.6"
      - binary_macos_conda:
          name: binary_macos_conda_py3.7
Edward Z. Yang's avatar
Edward Z. Yang committed
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
          python_version: "3.7"

  nightly:
    triggers:
      - schedule:
          cron: "0 9 * * *"
          filters:
            branches:
              only:
                - master
    jobs:
      - circleci_consistency
      
      - binary_linux_wheel:
          name: nightly_binary_linux_wheel_py2.7
          python_version: "2.7"
      - binary_wheel_upload:
          name: nightly_binary_linux_wheel_py2.7_upload
          context: org-member
          requires:
            - nightly_binary_linux_wheel_py2.7
      - binary_linux_wheel:
          name: nightly_binary_linux_wheel_py2.7_unicode
          python_version: "2.7"
          unicode_abi: "1"
      - binary_wheel_upload:
          name: nightly_binary_linux_wheel_py2.7_unicode_upload
          context: org-member
          requires:
            - nightly_binary_linux_wheel_py2.7_unicode
      - binary_linux_wheel:
          name: nightly_binary_linux_wheel_py3.5
          python_version: "3.5"
      - binary_wheel_upload:
          name: nightly_binary_linux_wheel_py3.5_upload
          context: org-member
          requires:
            - nightly_binary_linux_wheel_py3.5
      - binary_linux_wheel:
          name: nightly_binary_linux_wheel_py3.6
          python_version: "3.6"
      - binary_wheel_upload:
          name: nightly_binary_linux_wheel_py3.6_upload
          context: org-member
          requires:
            - nightly_binary_linux_wheel_py3.6
      - binary_linux_wheel:
          name: nightly_binary_linux_wheel_py3.7
          python_version: "3.7"
      - binary_wheel_upload:
          name: nightly_binary_linux_wheel_py3.7_upload
          context: org-member
          requires:
            - nightly_binary_linux_wheel_py3.7
      - binary_macos_wheel:
          name: nightly_binary_macos_wheel_py2.7
          python_version: "2.7"
      - binary_wheel_upload:
          name: nightly_binary_macos_wheel_py2.7_upload
          context: org-member
          requires:
            - nightly_binary_macos_wheel_py2.7
      - binary_macos_wheel:
          name: nightly_binary_macos_wheel_py2.7_unicode
          python_version: "2.7"
          unicode_abi: "1"
      - binary_wheel_upload:
          name: nightly_binary_macos_wheel_py2.7_unicode_upload
          context: org-member
          requires:
            - nightly_binary_macos_wheel_py2.7_unicode
      - binary_macos_wheel:
          name: nightly_binary_macos_wheel_py3.5
          python_version: "3.5"
      - binary_wheel_upload:
          name: nightly_binary_macos_wheel_py3.5_upload
          context: org-member
          requires:
            - nightly_binary_macos_wheel_py3.5
      - binary_macos_wheel:
          name: nightly_binary_macos_wheel_py3.6
          python_version: "3.6"
      - binary_wheel_upload:
          name: nightly_binary_macos_wheel_py3.6_upload
          context: org-member
          requires:
            - nightly_binary_macos_wheel_py3.6
      - binary_macos_wheel:
          name: nightly_binary_macos_wheel_py3.7
          python_version: "3.7"
      - binary_wheel_upload:
          name: nightly_binary_macos_wheel_py3.7_upload
          context: org-member
          requires:
            - nightly_binary_macos_wheel_py3.7
      - binary_linux_conda:
          name: nightly_binary_linux_conda_py2.7
          python_version: "2.7"
      - binary_conda_upload:
          name: nightly_binary_linux_conda_py2.7_upload
          context: org-member
          requires:
            - nightly_binary_linux_conda_py2.7
      - binary_linux_conda:
          name: nightly_binary_linux_conda_py3.5
          python_version: "3.5"
      - binary_conda_upload:
          name: nightly_binary_linux_conda_py3.5_upload
          context: org-member
          requires:
            - nightly_binary_linux_conda_py3.5
      - binary_linux_conda:
          name: nightly_binary_linux_conda_py3.6
          python_version: "3.6"
      - binary_conda_upload:
          name: nightly_binary_linux_conda_py3.6_upload
          context: org-member
          requires:
            - nightly_binary_linux_conda_py3.6
      - binary_linux_conda:
          name: nightly_binary_linux_conda_py3.7
          python_version: "3.7"
      - binary_conda_upload:
          name: nightly_binary_linux_conda_py3.7_upload
          context: org-member
          requires:
            - nightly_binary_linux_conda_py3.7
      - binary_macos_conda:
          name: nightly_binary_macos_conda_py2.7
          python_version: "2.7"
      - binary_conda_upload:
          name: nightly_binary_macos_conda_py2.7_upload
          context: org-member
          requires:
            - nightly_binary_macos_conda_py2.7
      - binary_macos_conda:
          name: nightly_binary_macos_conda_py3.5
          python_version: "3.5"
      - binary_conda_upload:
          name: nightly_binary_macos_conda_py3.5_upload
          context: org-member
          requires:
            - nightly_binary_macos_conda_py3.5
      - binary_macos_conda:
          name: nightly_binary_macos_conda_py3.6
          python_version: "3.6"
      - binary_conda_upload:
          name: nightly_binary_macos_conda_py3.6_upload
          context: org-member
          requires:
            - nightly_binary_macos_conda_py3.6
      - binary_macos_conda:
          name: nightly_binary_macos_conda_py3.7
          python_version: "3.7"
      - binary_conda_upload:
          name: nightly_binary_macos_conda_py3.7_upload
          context: org-member
          requires:
            - nightly_binary_macos_conda_py3.7