Skip to content

Commit

Permalink
split extra/core images
Browse files Browse the repository at this point in the history
Signed-off-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
mudler committed Oct 18, 2023
1 parent 37ea244 commit 6726475
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
if [ ! -e /run/systemd/system ]; then
sudo mkdir /run/systemd/system
fi
make prepare-e2e run-e2e-image test-e2e
make BUILD_TYPE=cublas prepare-e2e run-e2e-image test-e2e
- name: Release space from worker ♻
if: always()
run: |
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ run-e2e-image:

test-e2e:
@echo 'Running e2e tests'
LOCALAI_API=http://$(E2E_BRIDGE_IP):5390/v1 $(GOCMD) run github.com/onsi/ginkgo/v2/ginkgo --flake-attempts 5 -v -r ./tests/e2e
BUILD_TYPE=$(BUILD_TYPE) \
LOCALAI_API=http://$(E2E_BRIDGE_IP):5390/v1 \
$(GOCMD) run github.com/onsi/ginkgo/v2/ginkgo --flake-attempts 5 -v -r ./tests/e2e

teardown-e2e:
rm -rf ./tests/e2e-fixtures/ggllm-test-model.bin
Expand Down
15 changes: 10 additions & 5 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package e2e_test
import (
"context"
"fmt"
"os"
"os/exec"

. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -35,11 +36,15 @@ var _ = Describe("E2E test", func() {
// Check that the GPU was used
AfterEach(func() {
// Execute docker logs $$(docker ps -q --filter ancestor=localai-tests) as a command and check the output
cmd := exec.Command("/bin/bash", "-xce", "docker logs $(docker ps -q --filter ancestor=localai-tests)")
out, err := cmd.CombinedOutput()
Expect(err).ToNot(HaveOccurred(), string(out))
Expect(string(out)).To(ContainSubstring("found 1 CUDA devices"), string(out))
Expect(string(out)).To(ContainSubstring("using CUDA for GPU acceleration"), string(out))
if os.Getenv("BUILD_TYPE") == "cublas" {
cmd := exec.Command("/bin/bash", "-xce", "docker logs $(docker ps -q --filter ancestor=localai-tests)")
out, err := cmd.CombinedOutput()
Expect(err).ToNot(HaveOccurred(), string(out))
Expect(string(out)).To(ContainSubstring("found 1 CUDA devices"), string(out))
Expect(string(out)).To(ContainSubstring("using CUDA for GPU acceleration"), string(out))
} else {
fmt.Println("Skipping GPU check")
}
})

Context("Generates text", func() {
Expand Down

0 comments on commit 6726475

Please sign in to comment.