libstratis 2.4.2

Stratis daemon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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
157
158
159
160
161
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
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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
---
name: stratisd CI

# yamllint disable-line rule:truthy
on:
  push:
    branches:
      - master
      - develop-2.4.1
    paths-ignore:
      - 'CHANGES.txt'
      - '**/README.md'
  pull_request:
    branches:
      - master
      - develop-2.4.1
    paths-ignore:
      - 'CHANGES.txt'
      - '**/README.md'

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  checks:
    strategy:
      matrix:
        include:
          # MANDATORY CHECKS USING CURRENT DEVELOPMENT COMPILER
          - task: make -f Makefile fmt-travis
            toolchain: 1.52.1
            components: rustfmt
            image: ubuntu:groovy
          - task: make -f Makefile clippy
            toolchain: 1.52.1
            components: clippy
            image: ubuntu:groovy
          - task: make -f Makefile fmt-travis
            toolchain: 1.52.1
            components: rustfmt
            image: fedora:33
          - task: make -f Makefile clippy
            toolchain: 1.52.1
            components: clippy
            image: fedora:33
          # MANDATORY TESTING ON STABLE
          - task: make -f Makefile build
            toolchain: stable
            components: cargo
            image: ubuntu:groovy
          - task: make -f Makefile build-min
            toolchain: stable
            components: cargo
            image: ubuntu:groovy
          - task: make -f Makefile build-extras
            toolchain: stable
            components: cargo
            image: ubuntu:groovy
          - task: make -f Makefile docs-travis
            toolchain: stable
            components: cargo
            image: ubuntu:groovy
          - task: make -f Makefile test
            toolchain: stable
            components: cargo
            image: ubuntu:groovy
          - task: make -f Makefile release
            toolchain: stable
            components: cargo
            image: ubuntu:groovy
          - task: make -f Makefile release-min
            toolchain: stable
            components: cargo
            image: ubuntu:groovy
          - task: make -f Makefile build
            toolchain: stable
            components: cargo
            image: fedora:33
          - task: make -f Makefile build-min
            toolchain: stable
            components: cargo
            image: fedora:33
          - task: make -f Makefile build-extras
            toolchain: stable
            components: cargo
            image: fedora:33
          - task: make -f Makefile docs-travis
            toolchain: stable
            components: cargo
            image: fedora:33
          - task: make -f Makefile test
            toolchain: stable
            components: cargo
            image: fedora:33
          - task: make -f Makefile release
            toolchain: stable
            components: cargo
            image: fedora:33
          - task: make -f Makefile release-min
            toolchain: stable
            components: cargo
            image: fedora:33
    runs-on: ubuntu-18.04
    container:
      image: ${{ matrix.image }}
      options: --privileged -v /dev:/dev
    steps:
      - uses: actions/checkout@v2
      - name: Install dependencies for Ubuntu
        run: apt-get -q update
        if: matrix.image == 'ubuntu:groovy'
      - name: Install dependencies for Ubuntu
        run: >
          DEBIAN_FRONTEND=noninteractive
          apt-get install -y
          clang
          curl
          libblkid-dev
          libcryptsetup-dev
          libdbus-1-dev
          libsystemd-dev
          libudev-dev
          make
        if: matrix.image == 'ubuntu:groovy'
      - name: Install dependencies for Fedora
        run: >
          dnf install -y
          clang
          curl
          cryptsetup-devel
          dbus-devel
          libblkid-devel
          make
          systemd-devel
        if: matrix.image == 'fedora:33'
      - uses: actions-rs/toolchain@v1
        with:
          components: ${{ matrix.components }}
          toolchain: ${{ matrix.toolchain }}
          override: true
      - name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
        run: ${{ matrix.task }}

  # TESTS WITH UDEV
  checks_with_udev:
    strategy:
      matrix:
        include:
          # MANDATORY CHECKS USING CURRENT DEVELOPMENT COMPILER
          - task: RUST_LOG=libstratis=debug make -f Makefile test-loop
            toolchain: stable
            components: cargo
            image: ubuntu:groovy
          - task: RUST_LOG=libstratis=debug make -f Makefile test-loop
            toolchain: stable
            components: cargo
            image: fedora:33
    runs-on: ubuntu-18.04
    container:
      image: ${{ matrix.image }}
      options: --privileged -v /dev:/dev
    steps:
      - uses: actions/checkout@v2
      - name: Install dependencies for Ubuntu
        run: apt-get -q update
        if: matrix.image == 'ubuntu:groovy'
      - name: Install dependencies for Ubuntu
        run: >
          DEBIAN_FRONTEND=noninteractive
          apt-get install -y
          asciidoc
          clang
          curl
          libblkid-dev
          libcryptsetup-dev
          libdbus-1-dev
          libsystemd-dev
          libudev-dev
          make
          systemd
          thin-provisioning-tools
          udev
          xfsprogs
        if: matrix.image == 'ubuntu:groovy'
      - name: Install dependencies for Fedora
        run: >
          dnf install -y
          asciidoc
          clang
          cryptsetup-devel
          curl
          device-mapper-persistent-data
          dbus-devel
          libblkid-devel
          make
          systemd-devel
          systemd-udev
          xfsprogs
        if: matrix.image == 'fedora:33'
      - uses: actions-rs/toolchain@v1
        with:
          components: ${{ matrix.components }}
          toolchain: ${{ matrix.toolchain }}
          override: true
      - name: Install all necessary Stratis files
        run: make install
      - name: Start udev
        run: /usr/lib/systemd/systemd-udevd &
      - name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
        run: ${{ matrix.task }}

  # TESTS WITH TANG
  checks_with_tang:
    strategy:
      matrix:
        include:
          # MANDATORY CHECKS USING CURRENT DEVELOPMENT COMPILER
          - task: >-
              TANG_URL=tang
              RUST_LOG=libstratis=debug
              make -f Makefile test-clevis-loop
            toolchain: stable
            components: cargo
            image: fedora:33
    runs-on: ubuntu-18.04
    container:
      image: ${{ matrix.image }}
      options: --privileged -v /dev:/dev
    services:
      tang:
        image: docker.pkg.github.com/stratis-storage/stratisd/tang:32
        credentials:
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
        options: --privileged -p 80:80
    steps:
      - uses: actions/checkout@v2
      - name: Install dependencies for Fedora
        run: >
          dnf install -y
          clang
          cryptsetup-devel
          clevis
          clevis-luks
          curl
          device-mapper-persistent-data
          dbus-devel
          libblkid-devel
          make
          systemd-devel
          systemd-udev
          xfsprogs
      - name: Start udev
        run: /usr/lib/systemd/systemd-udevd &
      - uses: actions-rs/toolchain@v1
        with:
          components: ${{ matrix.components }}
          toolchain: ${{ matrix.toolchain }}
          override: true
      - name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
        run: ${{ matrix.task }}

  python-checks:
    strategy:
      matrix:
        include:
          # PYTHON CHECKS ON CURRENT FEDORA AND PYTHON TOOLS VERSION
          - dependencies: >
              pylint
              python3-dbus-client-gen
              python3-dbus-python-client-gen
              python3-psutil
              python3-pyudev
              python3-requests
              python3-semantic_version
              python3-pygithub
            image: fedora:33
            task: >
              (cd code_maintenance; make -f Makefile lint) &&
              (cd tests/client-dbus; PYTHONPATH=./src make -f Makefile lint)
          - dependencies: black python3-isort
            image: fedora:33
            task: >
              (cd code_maintenance; make -f Makefile fmt-travis) &&
              (cd tests/client-dbus; make -f Makefile fmt-travis)
          - dependencies: yamllint
            image: fedora:33
            task: make -f Makefile yamllint
    runs-on: ubuntu-18.04
    container: ${{ matrix.image }}
    steps:
      - uses: actions/checkout@v2
      - name: Install dependencies
        run: >
          dnf install -y
          make
          python-unversioned-command
          ${{ matrix.dependencies }}
      - name: Display Python version
        run: python --version
      - name: Run test
        run: ${{ matrix.task }}

  stratis-cli-checks:
    runs-on: ubuntu-18.04
    container: fedora:30  # LOWEST SUPPORTED ENVIRONMENT PROXY
    steps:
      - uses: actions/checkout@v2
      - name: Install dependencies
        run: >
          dnf install -y
          asciidoc
          clang
          cryptsetup-devel
          dbus-daemon
          dbus-tools
          dbus-devel
          libblkid-devel
          git
          make
          python3-coverage
          python3-dbus-client-gen
          python3-dbus-python-client-gen
          python3-justbytes
          python3-dateutil
          python3-psutil
          python3-semantic_version
          systemd-devel
      - uses: actions-rs/toolchain@v1
        with:
          components: cargo
          toolchain: 1.49.0  # LOWEST SUPPORTED RUST TOOLCHAIN
          override: true
      - name: Build stratisd
        run: PROFILEDIR=debug make -f Makefile install
      - name: Check out stratis-cli
        run: git clone https://github.com/stratis-storage/stratis-cli.git
      - name: Set up for D-Bus
        run: |
          mkdir -p /var/lib/dbus
          dbus-uuidgen > /var/lib/dbus/machine-id
          mkdir -p /var/run/dbus
      - name: Start D-Bus
        run: >
          dbus-daemon
          --config-file=/usr/share/dbus-1/system.conf
          --print-address
      - name: Run stratis-cli tests
        run: >
          RUST_LOG=libstratis=debug,stratisd=debug
          STRATISD=/usr/libexec/stratisd
          PYTHONPATH=./src
          make dbus-tests
        working-directory: ./stratis-cli

  # PYTHON-BASED TESTS WITH UDEV
  python-based-tests:
    strategy:
      matrix:
        include:
          # MANDATORY CHECKS USING CURRENT DEVELOPMENT ENVIRONMENT
          - image: fedora:33
            toolchain: 1.52.1  # CURRENT DEVELOPMENT RUST TOOLCHAIN
          # MANDATORY CHECKS USING LOWEST SUPPORTED ENVIRONMENT PROXY
          - image: fedora:30
            toolchain: 1.49.0  # LOWEST SUPPORTED RUST TOOLCHAIN
    runs-on: ubuntu-18.04
    container:
      image: ${{ matrix.image }}
      options: --privileged -v /dev:/dev
    steps:
      - uses: actions/checkout@v2
      - name: Install dependencies for Fedora
        run: >
          dnf install -y
          asciidoc
          clang
          cryptsetup-devel
          curl
          dbus-daemon
          dbus-devel
          dbus-tools
          device-mapper-persistent-data
          libblkid-devel
          make
          python3-dbus
          python3-dbus-client-gen
          python3-dbus-python-client-gen
          python3-psutil
          python3-pyudev
          systemd-devel
          systemd-udev
          xfsprogs
      - uses: actions-rs/toolchain@v1
        with:
          components: cargo
          toolchain: ${{ matrix.toolchain }}
          override: true
      - name: Install all necessary Stratis files
        run: PROFILEDIR=debug make -f Makefile install
      - name: Start udev
        run: /usr/lib/systemd/systemd-udevd &
      - name: Set up for D-Bus
        run: |
          mkdir -p /var/lib/dbus
          dbus-uuidgen > /var/lib/dbus/machine-id
          mkdir -p /var/run/dbus
      - name: Start D-Bus
        run: >
          dbus-daemon
          --config-file=/usr/share/dbus-1/system.conf
          --print-address
      - name: Tests on ${{ matrix.image }} using Rust ${{ matrix.toolchain }}
        run: >
          RUST_LOG=libstratis=debug,stratisd=debug
          STRATISD=/usr/libexec/stratisd
          STRATIS_PREDICT_USAGE=/usr/bin/stratis-predict-usage
          PYTHONPATH=./src
          make udev-tests
        working-directory: ./tests/client-dbus