update ci versions, minor tweaks to improve performance

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen 2022-12-21 03:00:39 -07:00
parent 524dd85c3d
commit a9cc6fb292
3 changed files with 137 additions and 120 deletions

View File

@ -13,14 +13,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Cancel Previous Runs - name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0 uses: styfle/cancel-workflow-action@0.11.0
with: with:
access_token: ${{ github.token }} access_token: ${{ github.token }}
build-npm-linux-amd64: build-npm-linux-amd64:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 16
@ -29,7 +29,7 @@ jobs:
run: | run: |
ci/bin/build.sh ci/bin/build.sh
- name: upload build - name: upload build
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: node-modules-linux-amd64 name: node-modules-linux-amd64
path: node_modules-linux-amd64.tar.gz path: node_modules-linux-amd64.tar.gz
@ -38,7 +38,7 @@ jobs:
build-npm-windows-amd64: build-npm-windows-amd64:
runs-on: windows-2022 runs-on: windows-2022
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 16
@ -47,7 +47,7 @@ jobs:
run: | run: |
ci\bin\build.ps1 ci\bin\build.ps1
- name: upload build - name: upload build
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: node-modules-windows-amd64 name: node-modules-windows-amd64
path: node_modules-windows-amd64.tar.gz path: node_modules-windows-amd64.tar.gz
@ -67,8 +67,8 @@ jobs:
- X64 - X64
- csi-sanity-synology - csi-sanity-synology
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: node-modules-linux-amd64 name: node-modules-linux-amd64
- name: csi-sanity - name: csi-sanity
@ -97,8 +97,8 @@ jobs:
- X64 - X64
- csi-sanity-synology - csi-sanity-synology
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: node-modules-linux-amd64 name: node-modules-linux-amd64
- name: csi-sanity - name: csi-sanity
@ -132,8 +132,8 @@ jobs:
- csi-sanity-truenas - csi-sanity-truenas
#- csi-sanity-zfs-generic #- csi-sanity-zfs-generic
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: node-modules-linux-amd64 name: node-modules-linux-amd64
- name: csi-sanity - name: csi-sanity
@ -164,8 +164,8 @@ jobs:
#- csi-sanity-truenas #- csi-sanity-truenas
- csi-sanity-zfs-generic - csi-sanity-zfs-generic
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: node-modules-linux-amd64 name: node-modules-linux-amd64
- name: csi-sanity - name: csi-sanity
@ -198,8 +198,8 @@ jobs:
#- csi-sanity-truenas #- csi-sanity-truenas
- csi-sanity-zfs-generic - csi-sanity-zfs-generic
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: node-modules-linux-amd64 name: node-modules-linux-amd64
- name: csi-sanity - name: csi-sanity
@ -231,8 +231,8 @@ jobs:
#- csi-sanity-truenas #- csi-sanity-truenas
- csi-sanity-zfs-generic - csi-sanity-zfs-generic
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: node-modules-linux-amd64 name: node-modules-linux-amd64
- name: csi-sanity - name: csi-sanity
@ -263,8 +263,8 @@ jobs:
- X64 - X64
- csi-sanity-zfs-generic - csi-sanity-zfs-generic
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: node-modules-linux-amd64 name: node-modules-linux-amd64
- name: csi-sanity - name: csi-sanity
@ -293,8 +293,8 @@ jobs:
- X64 - X64
- csi-sanity-client - csi-sanity-client
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: node-modules-linux-amd64 name: node-modules-linux-amd64
- name: csi-sanity - name: csi-sanity
@ -321,8 +321,8 @@ jobs:
- X64 - X64
- csi-sanity-client - csi-sanity-client
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: node-modules-windows-amd64 name: node-modules-windows-amd64
- name: csi-sanity - name: csi-sanity
@ -351,8 +351,8 @@ jobs:
- X64 - X64
- csi-sanity-zfs-local - csi-sanity-zfs-local
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: node-modules-linux-amd64 name: node-modules-linux-amd64
- name: csi-sanity - name: csi-sanity
@ -390,8 +390,8 @@ jobs:
- X64 - X64
- csi-sanity-local-hostpath - csi-sanity-local-hostpath
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: ${{ matrix.npmartifact }} name: ${{ matrix.npmartifact }}
- name: csi-sanity - name: csi-sanity
@ -414,8 +414,8 @@ jobs:
- Windows - Windows
- X64 - X64
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: node-modules-windows-amd64 name: node-modules-windows-amd64
- name: csi-sanity - name: csi-sanity
@ -469,7 +469,7 @@ jobs:
- csi-sanity-windows-node - csi-sanity-windows-node
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: docker build - name: docker build
run: | run: |
export ARCH=$([ $(uname -m) = "x86_64" ] && echo "amd64" || echo "arm64") export ARCH=$([ $(uname -m) = "x86_64" ] && echo "amd64" || echo "arm64")
@ -520,7 +520,7 @@ jobs:
nano_base_tag: ltsc2022 nano_base_tag: ltsc2022
file: Dockerfile.Windows file: Dockerfile.Windows
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: docker build - name: docker build
shell: bash shell: bash
run: | run: |
@ -532,7 +532,7 @@ jobs:
docker inspect democratic-csi-windows:${GITHUB_RUN_ID}-${{ matrix.core_base_tag }} docker inspect democratic-csi-windows:${GITHUB_RUN_ID}-${{ matrix.core_base_tag }}
docker save democratic-csi-windows:${GITHUB_RUN_ID}-${{ matrix.core_base_tag }} -o democratic-csi-windows-${{ matrix.core_base_tag }}.tar docker save democratic-csi-windows:${GITHUB_RUN_ID}-${{ matrix.core_base_tag }} -o democratic-csi-windows-${{ matrix.core_base_tag }}.tar
- name: upload image tar - name: upload image tar
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: democratic-csi-windows-${{ matrix.core_base_tag }}.tar name: democratic-csi-windows-${{ matrix.core_base_tag }}.tar
path: democratic-csi-windows-${{ matrix.core_base_tag }}.tar path: democratic-csi-windows-${{ matrix.core_base_tag }}.tar
@ -547,7 +547,7 @@ jobs:
- self-hosted - self-hosted
- buildah - buildah
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: democratic-csi-windows-ltsc2019.tar name: democratic-csi-windows-ltsc2019.tar

View File

@ -75,7 +75,7 @@ COPY --from=build /usr/local/lib/nodejs/bin/node /usr/local/bin/node
# netbase is required by rpcbind/rpcinfo to work properly # netbase is required by rpcbind/rpcinfo to work properly
# /etc/{services,rpc} are required # /etc/{services,rpc} are required
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y netbase socat e2fsprogs exfatprogs xfsprogs btrfs-progs fatresize dosfstools ntfs-3g nfs-common cifs-utils fdisk gdisk cloud-guest-utils sudo rsync procps util-linux && \ apt-get install -y netbase socat e2fsprogs exfatprogs xfsprogs btrfs-progs fatresize dosfstools ntfs-3g nfs-common cifs-utils fdisk gdisk cloud-guest-utils sudo rsync procps util-linux nvme-cli && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# controller requirements # controller requirements

View File

@ -2369,99 +2369,116 @@ class CsiBaseDriver {
// TODO: this could be made async to detach all simultaneously // TODO: this could be made async to detach all simultaneously
for (const block_device_info_i of realBlockDeviceInfos) { for (const block_device_info_i of realBlockDeviceInfos) {
if (await filesystem.deviceIsIscsi(block_device_info_i.path)) { switch (block_device_info_i.tran) {
let parent_block_device = await filesystem.getBlockDeviceParent( case "iscsi":
block_device_info_i.path {
); if (
await filesystem.deviceIsIscsi(block_device_info_i.path)
) {
let parent_block_device =
await filesystem.getBlockDeviceParent(
block_device_info_i.path
);
// figure out which iscsi session this belongs to and logout // figure out which iscsi session this belongs to and logout
// scan /dev/disk/by-path/ip-*? // scan /dev/disk/by-path/ip-*?
// device = `/dev/disk/by-path/ip-${volume_context.portal}-iscsi-${volume_context.iqn}-lun-${volume_context.lun}`; // device = `/dev/disk/by-path/ip-${volume_context.portal}-iscsi-${volume_context.iqn}-lun-${volume_context.lun}`;
// parse output from `iscsiadm -m session -P 3` // parse output from `iscsiadm -m session -P 3`
let sessions = await iscsi.iscsiadm.getSessionsDetails(); let sessions = await iscsi.iscsiadm.getSessionsDetails();
for (let i = 0; i < sessions.length; i++) { for (let i = 0; i < sessions.length; i++) {
let session = sessions[i]; let session = sessions[i];
let is_attached_to_session = false; let is_attached_to_session = false;
if ( if (
session.attached_scsi_devices && session.attached_scsi_devices &&
session.attached_scsi_devices.host && session.attached_scsi_devices.host &&
session.attached_scsi_devices.host.devices session.attached_scsi_devices.host.devices
) { ) {
is_attached_to_session = is_attached_to_session =
session.attached_scsi_devices.host.devices.some( session.attached_scsi_devices.host.devices.some(
(device) => { (device) => {
if ( if (
device.attached_scsi_disk == parent_block_device.name device.attached_scsi_disk ==
) { parent_block_device.name
return true; ) {
return true;
}
return false;
}
);
}
if (is_attached_to_session) {
let timer_start;
let timer_max;
timer_start = Math.round(new Date().getTime() / 1000);
timer_max = 30;
let loggedOut = false;
while (!loggedOut) {
try {
await iscsi.iscsiadm.logout(session.target, [
session.persistent_portal,
]);
loggedOut = true;
} catch (err) {
await GeneralUtils.sleep(2000);
let current_time = Math.round(
new Date().getTime() / 1000
);
if (current_time - timer_start > timer_max) {
// not throwing error for now as future invocations would not enter code path anyhow
loggedOut = true;
//throw new GrpcError(
// grpc.status.UNKNOWN,
// `hit timeout trying to logout of iscsi target: ${session.persistent_portal}`
//);
}
}
}
timer_start = Math.round(new Date().getTime() / 1000);
timer_max = 30;
let deletedEntry = false;
while (!deletedEntry) {
try {
await iscsi.iscsiadm.deleteNodeDBEntry(
session.target,
session.persistent_portal
);
deletedEntry = true;
} catch (err) {
await GeneralUtils.sleep(2000);
let current_time = Math.round(
new Date().getTime() / 1000
);
if (current_time - timer_start > timer_max) {
// not throwing error for now as future invocations would not enter code path anyhow
deletedEntry = true;
//throw new GrpcError(
// grpc.status.UNKNOWN,
// `hit timeout trying to delete iscsi node DB entry: ${session.target}, ${session.persistent_portal}`
//);
}
}
} }
return false;
} }
}
}
}
break;
case "nvme":
{
if (
await filesystem.deviceIsNVMEoF(block_device_info_i.path)
) {
let nqn = await nvmeof.nqnByNamespaceDeviceName(
block_device_info_i.name
); );
} await nvmeof.disconnectByNQN(nqn);
if (is_attached_to_session) {
let timer_start;
let timer_max;
timer_start = Math.round(new Date().getTime() / 1000);
timer_max = 30;
let loggedOut = false;
while (!loggedOut) {
try {
await iscsi.iscsiadm.logout(session.target, [
session.persistent_portal,
]);
loggedOut = true;
} catch (err) {
await GeneralUtils.sleep(2000);
let current_time = Math.round(
new Date().getTime() / 1000
);
if (current_time - timer_start > timer_max) {
// not throwing error for now as future invocations would not enter code path anyhow
loggedOut = true;
//throw new GrpcError(
// grpc.status.UNKNOWN,
// `hit timeout trying to logout of iscsi target: ${session.persistent_portal}`
//);
}
}
}
timer_start = Math.round(new Date().getTime() / 1000);
timer_max = 30;
let deletedEntry = false;
while (!deletedEntry) {
try {
await iscsi.iscsiadm.deleteNodeDBEntry(
session.target,
session.persistent_portal
);
deletedEntry = true;
} catch (err) {
await GeneralUtils.sleep(2000);
let current_time = Math.round(
new Date().getTime() / 1000
);
if (current_time - timer_start > timer_max) {
// not throwing error for now as future invocations would not enter code path anyhow
deletedEntry = true;
//throw new GrpcError(
// grpc.status.UNKNOWN,
// `hit timeout trying to delete iscsi node DB entry: ${session.target}, ${session.persistent_portal}`
//);
}
}
} }
} }
} break;
} else if (await filesystem.deviceIsNVMEoF(block_device_info_i.path)) {
let nqn = await nvmeof.nqnByNamespaceDeviceName(
block_device_info_i.name
);
await nvmeof.disconnectByNQN(nqn);
} }
} }
} }