Skip to content

Commit

Permalink
feat: Add NUMA support
Browse files Browse the repository at this point in the history
* Add mount point for coredumps
  • Loading branch information
uristdwarf committed Sep 17, 2024
1 parent fab6923 commit c42cc73
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
apt-get install --yes \
lcov \
tini build-essential libblkid-dev libboost-filesystem-dev libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libcrcutil-dev libdb-dev libfmt-dev libfuse3-dev libgoogle-perftools-dev libgtest-dev libisal-dev libjudy-dev libpam0g-dev libspdlog-dev libsystemd-dev libthrift-dev libtirpc-dev liburcu-dev libyaml-cpp-dev netcat-openbsd python3-venv uuid-dev zlib1g-dev docbook docbook-xml krb5-user libacl1-dev libcap-dev libcephfs-dev libdbus-1-dev libglusterfs-dev libgssapi-krb5-2 libjemalloc-dev libkrb5-dev libkrb5support0 libnfsidmap-dev libradospp-dev libradosstriper-dev librgw-dev libsqlite3-dev xfslibs-dev \
acl asciidoc attr automake bash-completion bc ccache cmake curl dbench debhelper devscripts fakeroot fio fuse3 gcc git gnupg2 kmod lcov make nfs4-acl-tools pkg-config pylint python3-pip python3-setuptools python3-wheel psmisc rsync rsyslog socat sudo tidy time valgrind wget bison byacc ceph dbus doxygen flex tree
acl asciidoc attr automake bash-completion bc ccache cmake curl dbench debhelper devscripts fakeroot fio fuse3 gcc git gnupg2 kmod lcov make nfs4-acl-tools pkg-config pylint python3-pip python3-setuptools python3-wheel psmisc rsync rsyslog socat sudo tidy time valgrind wget bison byacc ceph dbus doxygen flex tree

WORKDIR /saunafs
COPY ./tests/setup_machine.sh ./tests/
Expand All @@ -26,7 +26,7 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
./tests/setup_machine.sh setup /mnt/hdd_0 /mnt/hdd_1 /mnt/hdd_2 /mnt/hdd_3 /mnt/hdd_4 /mnt/hdd_5 /mnt/hdd_6 /mnt/hdd_7 || true

RUN mkdir -p /mnt/hdd_0/ /mnt/hdd_1/ /mnt/hdd_2/ /mnt/hdd_3/ /mnt/hdd_4/ /mnt/hdd_5/ /mnt/hdd_6/ /mnt/hdd_7/
RUN chown saunafstest:saunafstest -R /mnt/hdd_*
RUN chown saunafstest:saunafstest -R /mnt/hdd_*

### Build Phase
FROM test-setup AS test-build
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile.pro.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
apt-get install --yes \
lcov \
tini build-essential libblkid-dev libboost-filesystem-dev libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libcrcutil-dev libdb-dev libfmt-dev libfuse3-dev libgoogle-perftools-dev libgtest-dev libisal-dev libjudy-dev libpam0g-dev libspdlog-dev libsystemd-dev libthrift-dev libtirpc-dev liburcu-dev libyaml-cpp-dev netcat-openbsd python3-venv uuid-dev zlib1g-dev docbook docbook-xml krb5-user libacl1-dev libcap-dev libcephfs-dev libdbus-1-dev libglusterfs-dev libgssapi-krb5-2 libjemalloc-dev libkrb5-dev libkrb5support0 libnfsidmap-dev libradospp-dev libradosstriper-dev librgw-dev libsqlite3-dev xfslibs-dev \
acl asciidoc attr automake bash-completion bc ccache cmake curl dbench debhelper devscripts fakeroot fio fuse3 gcc git gnupg2 kmod lcov make nfs4-acl-tools pkg-config pylint python3-pip python3-setuptools python3-wheel psmisc rsync rsyslog socat sudo tidy time valgrind wget bison byacc ceph dbus doxygen flex tree

acl asciidoc attr automake bash-completion bc ccache cmake curl dbench debhelper devscripts fakeroot fio fuse3 gcc git gnupg2 kmod lcov make nfs4-acl-tools pkg-config pylint python3-pip python3-setuptools python3-wheel psmisc rsync rsyslog socat sudo tidy time valgrind wget bison byacc ceph dbus doxygen flex tree zonefs-tools

WORKDIR /saunafs
COPY ./saunafs/tests/setup_machine.sh ./tests/
Expand All @@ -27,7 +26,7 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
./tests/setup_machine.sh setup /mnt/hdd_0 /mnt/hdd_1 /mnt/hdd_2 /mnt/hdd_3 /mnt/hdd_4 /mnt/hdd_5 /mnt/hdd_6 /mnt/hdd_7 || true

RUN mkdir -p /mnt/hdd_0/ /mnt/hdd_1/ /mnt/hdd_2/ /mnt/hdd_3/ /mnt/hdd_4/ /mnt/hdd_5/ /mnt/hdd_6/ /mnt/hdd_7/
RUN chown saunafstest:saunafstest -R /mnt/hdd_*
RUN chown saunafstest:saunafstest -R /mnt/hdd_*

### Build Phase
FROM test-setup AS test-build
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
apt-get install --yes \
lcov \
tini build-essential libblkid-dev libboost-filesystem-dev libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libcrcutil-dev libdb-dev libfmt-dev libfuse3-dev libgoogle-perftools-dev libgtest-dev libisal-dev libjudy-dev libpam0g-dev libspdlog-dev libsystemd-dev libthrift-dev libtirpc-dev liburcu-dev libyaml-cpp-dev netcat-openbsd python3-venv uuid-dev zlib1g-dev docbook docbook-xml krb5-user libacl1-dev libcap-dev libcephfs-dev libdbus-1-dev libglusterfs-dev libgssapi-krb5-2 libjemalloc-dev libkrb5-dev libkrb5support0 libnfsidmap-dev libradospp-dev libradosstriper-dev librgw-dev libsqlite3-dev xfslibs-dev \
acl asciidoc attr automake bash-completion bc ccache cmake curl dbench debhelper devscripts fakeroot fio fuse3 gcc git gnupg2 kmod lcov make nfs4-acl-tools pkg-config pylint python3-pip python3-setuptools python3-wheel psmisc rsync rsyslog socat sudo tidy time valgrind wget bison byacc ceph dbus doxygen flex tree
acl asciidoc attr automake bash-completion bc ccache cmake curl dbench debhelper devscripts fakeroot fio fuse3 gcc git gnupg2 kmod lcov make nfs4-acl-tools pkg-config pylint python3-pip python3-setuptools python3-wheel psmisc rsync rsyslog socat sudo tidy time valgrind wget bison byacc ceph dbus doxygen flex tree


WORKDIR /saunafs
Expand All @@ -27,7 +27,7 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
./tests/setup_machine.sh setup /mnt/hdd_0 /mnt/hdd_1 /mnt/hdd_2 /mnt/hdd_3 /mnt/hdd_4 /mnt/hdd_5 /mnt/hdd_6 /mnt/hdd_7 || true

RUN mkdir -p /mnt/hdd_0/ /mnt/hdd_1/ /mnt/hdd_2/ /mnt/hdd_3/ /mnt/hdd_4/ /mnt/hdd_5/ /mnt/hdd_6/ /mnt/hdd_7/
RUN chown saunafstest:saunafstest -R /mnt/hdd_*
RUN chown saunafstest:saunafstest -R /mnt/hdd_*

### Build Phase
FROM test-setup AS test-build
Expand Down
20 changes: 15 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ type testOptions struct {
Source string
TestPattern string
MountPoint string
SkipUpgradeTests bool
CoreMount string
SkipUpgradeTests bool
AllOutput bool
DeleteContainers bool
Multiplier int
Expand Down Expand Up @@ -74,6 +75,8 @@ func init() {

flag.StringVar(&options.MountPoint, "mount", "", "SaunaFS git repository to mount")
flag.StringVar(&options.MountPoint, "m", "", "shorthand for -mount")

flag.StringVar(&options.CoreMount, "core-mount", "", "Mount place for cores")
}

const (
Expand All @@ -91,6 +94,8 @@ var hostConfig = container.HostConfig{
CgroupPermissions: "rwm",
},
},
CpusetCpus: os.Getenv("NUMA_CPUSET"),
CpusetMems: os.Getenv("NUMA_MEM_NODE"),
Ulimits: []*units.Ulimit{
{
Name: "core",
Expand Down Expand Up @@ -161,9 +166,14 @@ func runTests(ctx context.Context, client *client.Client) int {
tests := make([]*Test, 0, len(suite))

if options.MountPoint != "" {
hostConfig.Mounts = []mount.Mount{
{Type: mount.TypeBind, Source: options.MountPoint, Target: "/saunafs"},
}
hostConfig.Mounts = append(hostConfig.Mounts, mount.Mount{
Type: mount.TypeBind, Source: options.MountPoint, Target: "/saunafs",
})
}
if options.CoreMount != "" {
hostConfig.Mounts = append(hostConfig.Mounts, mount.Mount{
Type: mount.TypeBind, Source: options.CoreMount, Target: filepath.Dir(corePattern),
})
}

var wg sync.WaitGroup
Expand Down Expand Up @@ -395,7 +405,7 @@ func getTestGlobs(ctx context.Context, client *client.Client) map[string][]strin
suites := getSuites(ctx, client, name)
for suite := range suites {
execConfig := types.ExecConfig{
Cmd: []string{"bash", "-c", "ls -1 /saunafs/tests/test_suites/" + suite + "/" + options.TestPattern},
Cmd: []string{"bash", "-c", "ls -1 /saunafs/tests/test_suites/" + suite + "/" + options.TestPattern + ".sh"},
AttachStdout: true,
AttachStderr: false,
}
Expand Down

0 comments on commit c42cc73

Please sign in to comment.