Skip to content

Commit

Permalink
Vec 210 acl (#3)
Browse files Browse the repository at this point in the history
* VEC-210 add acl management commands
  • Loading branch information
Jesse S authored Jul 3, 2024
1 parent 5700529 commit 7a3906b
Show file tree
Hide file tree
Showing 39 changed files with 1,698 additions and 418 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/create-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ on:

push:
branches:
- "VEC-189-tls" # remove before merge into main
- "VEC-210-acl" # remove before merge into main
jobs:
build-and-release:
runs-on: macos-13
steps:
- name: "Git checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Install Homebrew"
run: /bin/bash -c "NONINTERACTIVE=1 $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: "Install Dependencies"
Expand Down Expand Up @@ -111,11 +113,12 @@ jobs:
cd ~/work/asvec/asvec/bin/packages
COMMIT=$(git rev-parse --short HEAD)
VER=$(cat ../../VERSION.md)
RPM_VER=$(echo ${VER} | sed 's/-/_/g')
BRANCH=$(git rev-parse --abbrev-ref HEAD)
TAG=${VER}-${COMMIT}
[ "${ADDCOMMIT}" = "false" ] && TAG=${VER}
FULLCOMMIT=$(git rev-parse HEAD)
gh release create -R github.com/aerospike/asvec --notes-file ../../RELEASE.md --prerelease --target ${FULLCOMMIT} --title "Asvec - v${TAG}" ${TAG} asvec-linux-amd64-${VER}.deb asvec-linux-amd64-${VER}.rpm asvec-linux-amd64-${VER}.zip asvec-linux-arm64-${VER}.deb asvec-linux-arm64-${VER}.rpm asvec-linux-arm64-${VER}.zip asvec-macos-${VER}.pkg asvec-macos-amd64-${VER}.zip asvec-macos-arm64-${VER}.zip asvec-windows-amd64-${VER}.zip asvec-windows-arm64-${VER}.zip
gh release create -R github.com/aerospike/asvec --notes-file ../../RELEASE.md --prerelease --target ${FULLCOMMIT} --title "Asvec - v${TAG}" ${TAG} asvec-linux-amd64-${VER}.deb asvec-linux-amd64-${RPM_VER}.rpm asvec-linux-amd64-${VER}.zip asvec-linux-arm64-${VER}.deb asvec-linux-arm64-${RPM_VER}.rpm asvec-linux-arm64-${VER}.zip asvec-macos-${VER}.pkg asvec-macos-amd64-${VER}.zip asvec-macos-arm64-${VER}.zip asvec-windows-amd64-${VER}.zip asvec-windows-arm64-${VER}.zip
- name: "Delete previous pre-release"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
File renamed without changes.
8 changes: 7 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ jobs:
FEATURES_CONF : ${{secrets.FEATURES_CONF}}

run: |
echo "$FEATURES_CONF" > docker/config/features.conf
echo "$FEATURES_CONF" > docker/vanilla/config/features.conf
echo "$FEATURES_CONF" > docker/tls/config/features.conf
echo "$FEATURES_CONF" > docker/mtls/config/features.conf
echo "$FEATURES_CONF" > docker/auth/config/features.conf
- name: Login to Aerospike Jfrog
run: |
docker login aerospike.jfrog.io --username ${{ secrets.JFROG_USERNAME }} --password ${{ secrets.JFROG_ACCESS_TOKEN }}
- name: Run tests
run: |
make coverage
Expand Down
41 changes: 22 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ clean:

OS := $(shell uname -o)
CPU := $(shell uname -m)
ver:=$(shell V=$$(git branch --show-current); if [[ $$V == v* ]]; then printf $${V:1} > ./VERSION.md; fi; cat ./VERSION.md)
ver:=$(shell V=$$(git describe --tags --always); printf $${V} > ./VERSION.md; cat ./VERSION.md)
rpm_ver := $(shell echo $(ver) | sed 's/-/_/g')
$(info ver is $(ver) and rpm_ver is $(rpm_ver))
GO_LDFLAGS="-X 'asvec/cmd.Version=$(ver)' -s -w"
define _amddebscript
ver=$(cat ./VERSION.md)
cat <<EOF > ./bin/deb/DEBIAN/control
Expand Down Expand Up @@ -241,68 +244,68 @@ prep:

.PHONY: compile_linux_wip_amd64
compile_linux_wip_amd64:
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o asvec-linux-amd64-wip
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-linux-amd64-wip
ifneq (, $(shell which upx))
upx asvec-linux-amd64-wip
endif

.PHONY: compile_linux_wip_arm64
compile_linux_wip_arm64:
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o asvec-linux-arm64-wip
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-linux-arm64-wip
ifneq (, $(shell which upx))
upx asvec-linux-arm64-wip
endif

.PHONY: compile_linux_amd64
compile_linux_amd64:
printf "package main\n\nimport _ \"embed\"\n\nvar nLinuxBinaryX64 []byte\n\n//go:embed asvec-linux-arm64-wip\nvar nLinuxBinaryArm64 []byte\n" > embed_linux.go
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o asvec-linux-amd64
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-linux-amd64
mv asvec-linux-amd64 $(BIN_DIR)/

.PHONY: compile_linux_arm64
compile_linux_arm64:
printf "package main\n\nimport _ \"embed\"\n\n//go:embed asvec-linux-amd64-wip\nvar nLinuxBinaryX64 []byte\n\nvar nLinuxBinaryArm64 []byte\n" > embed_linux.go
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o asvec-linux-arm64
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-linux-arm64
mv asvec-linux-arm64 $(BIN_DIR)/

.PHONY: compile_darwin
compile_darwin:
printf "package main\n\nimport _ \"embed\"\n\n//go:embed asvec-linux-amd64-wip\nvar nLinuxBinaryX64 []byte\n\n//go:embed asvec-linux-arm64-wip\nvar nLinuxBinaryArm64 []byte" > embed_darwin.go
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o asvec-macos-amd64
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o asvec-macos-arm64
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-macos-amd64
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-macos-arm64
mv asvec-macos-amd64 $(BIN_DIR)/
mv asvec-macos-arm64 $(BIN_DIR)/

.PHONY: compile_darwin_amd64
compile_darwin_amd64:
printf "package main\n\nimport _ \"embed\"\n\n//go:embed asvec-linux-amd64-wip\nvar nLinuxBinaryX64 []byte\n\n//go:embed asvec-linux-arm64-wip\nvar nLinuxBinaryArm64 []byte" > embed_darwin.go
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o asvec-macos-amd64
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-macos-amd64
mv asvec-macos-amd64 $(BIN_DIR)/

.PHONY: compile_darwin_arm64
compile_darwin_arm64:
printf "package main\n\nimport _ \"embed\"\n\n//go:embed asvec-linux-amd64-wip\nvar nLinuxBinaryX64 []byte\n\n//go:embed asvec-linux-arm64-wip\nvar nLinuxBinaryArm64 []byte" > embed_darwin.go
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o asvec-macos-arm64
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-macos-arm64
mv asvec-macos-arm64 $(BIN_DIR)/

.PHONY: compile_windows
compile_windows:
printf "package main\n\nimport _ \"embed\"\n\n//go:embed asvec-linux-amd64-wip\nvar nLinuxBinaryX64 []byte\n\n//go:embed asvec-linux-arm64-wip\nvar nLinuxBinaryArm64 []byte" > embed_windows.go
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o asvec-windows-amd64.exe
env CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o asvec-windows-arm64.exe
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-windows-amd64.exe
env CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-windows-arm64.exe
mv asvec-windows-amd64.exe $(BIN_DIR)/
mv asvec-windows-arm64.exe $(BIN_DIR)/

.PHONY: compile_windows_amd64
compile_windows_amd64:
printf "package main\n\nimport _ \"embed\"\n\n//go:embed asvec-linux-amd64-wip\nvar nLinuxBinaryX64 []byte\n\n//go:embed asvec-linux-arm64-wip\nvar nLinuxBinaryArm64 []byte" > embed_windows.go
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o asvec-windows-amd64.exe
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-windows-amd64.exe
mv asvec-windows-amd64.exe $(BIN_DIR)/

.PHONY: compile_windows_arm64
compile_windows_arm64:
printf "package main\n\nimport _ \"embed\"\n\n//go:embed asvec-linux-amd64-wip\nvar nLinuxBinaryX64 []byte\n\n//go:embed asvec-linux-arm64-wip\nvar nLinuxBinaryArm64 []byte" > embed_windows.go
env CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o asvec-windows-arm64.exe
env CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath -ldflags=$(GO_LDFLAGS) -o asvec-windows-arm64.exe
mv asvec-windows-arm64.exe $(BIN_DIR)/

.PHONY: official
Expand Down Expand Up @@ -388,23 +391,23 @@ pkg-zip: pkg-zip-amd64 pkg-zip-arm64
pkg-rpm-amd64:
rm -rf $(BIN_DIR)/asvec-rpm-centos
cp -a $(BIN_DIR)/asvecrpm $(BIN_DIR)/asvec-rpm-centos
sed -i.bak "s/VERSIONHERE/${ver}/g" $(BIN_DIR)/asvec-rpm-centos/asvec.spec
sed -i.bak "s/VERSIONHERE/${rpm_ver}/g" $(BIN_DIR)/asvec-rpm-centos/asvec.spec
cp $(BIN_DIR)/asvec-linux-amd64 $(BIN_DIR)/asvec-rpm-centos/usr/local/aerospike/bin/asvec
rm -f $(BIN_DIR)/asvec-linux-x86_64.rpm
bash -ce "cd $(BIN_DIR) && rpmbuild --target=x86_64-redhat-linux --buildroot \$$(pwd)/asvec-rpm-centos -bb asvec-rpm-centos/asvec.spec"
rm -f $(BIN_DIR)/packages/asvec-linux-amd64-${ver}.rpm
mv $(BIN_DIR)/asvec-linux-x86_64.rpm $(BIN_DIR)/packages/asvec-linux-amd64-${ver}.rpm
rm -f $(BIN_DIR)/packages/asvec-linux-amd64-${rpm_ver}.rpm
mv $(BIN_DIR)/asvec-linux-x86_64.rpm $(BIN_DIR)/packages/asvec-linux-amd64-${rpm_ver}.rpm

.PHONY: pkg-rpm-arm64
pkg-rpm-arm64:
rm -rf $(BIN_DIR)/asvec-rpm-centos
cp -a $(BIN_DIR)/asvecrpm $(BIN_DIR)/asvec-rpm-centos
sed -i.bak "s/VERSIONHERE/${ver}/g" $(BIN_DIR)/asvec-rpm-centos/asvec.spec
sed -i.bak "s/VERSIONHERE/${rpm_ver}/g" $(BIN_DIR)/asvec-rpm-centos/asvec.spec
cp $(BIN_DIR)/asvec-linux-arm64 $(BIN_DIR)/asvec-rpm-centos/usr/local/aerospike/bin/asvec
rm -f $(BIN_DIR)/asvec-linux-arm64.rpm
bash -ce "cd $(BIN_DIR) && rpmbuild --target=arm64-redhat-linux --buildroot \$$(pwd)/asvec-rpm-centos -bb asvec-rpm-centos/asvec.spec"
rm -f $(BIN_DIR)/packages/asvec-linux-arm64-${ver}.rpm
mv $(BIN_DIR)/asvec-linux-arm64.rpm $(BIN_DIR)/packages/asvec-linux-arm64-${ver}.rpm
rm -f $(BIN_DIR)/packages/asvec-linux-arm64-${rpm_ver}.rpm
mv $(BIN_DIR)/asvec-linux-arm64.rpm $(BIN_DIR)/packages/asvec-linux-arm64-${rpm_ver}.rpm

.PHONY: pkg-rpm
pkg-rpm: pkg-rpm-amd64 pkg-rpm-arm64
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ efficiency and productivity for users getting started with vector search.

Ensure you have an AVS instance up and running for `asvec` to connect to.
Checkout out the [AVS documentation](https://aerospike.com/docs/vector) for
options on getting started.
instructions on getting started.

### Installation

Expand Down
5 changes: 5 additions & 0 deletions cmd/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package cmd

const (
HelpTxtSetupEnv = "export ASVEC_HOST=<avs-ip>:5000 ASVEC_USER=<user> ASVEC_PASSWORD=<password>"
)
23 changes: 0 additions & 23 deletions cmd/create.go

This file was deleted.

23 changes: 0 additions & 23 deletions cmd/drop.go

This file was deleted.

118 changes: 0 additions & 118 deletions cmd/dropIndex.go

This file was deleted.

Loading

0 comments on commit 7a3906b

Please sign in to comment.