Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #35

Merged
merged 9 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,83 @@ jobs:
exit 2
}
Write-Output "Uninstall verification passed."

install-version-opencv:
name: Install MetaCall with Specific Version
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install MetaCall
run: |
powershell -NoProfile -ExecutionPolicy unrestricted ./install.ps1 -Version 0.1.7

- name: NodeJS Test
shell: cmd
run: |
metacall ./test/script.js | findstr "123456"
IF %ERRORLEVEL% NEQ 0 exit /B 1

- name: Python Test
shell: cmd
run: |
metacall pip install -r test/requirements.txt | findstr "Successfully installed"
IF %ERRORLEVEL% NEQ 0 exit /B 1
metacall ./test/requirements.py | findstr "123456"
IF %ERRORLEVEL% NEQ 0 exit /B 1

- name: Python OpenCV Test (Install OpenCV)
shell: cmd
run: |
metacall pip install -r test/opencv/requirements.txt | findstr "Successfully installed"
IF %ERRORLEVEL% NEQ 0 exit /B 1

# For some reason, OpenCV fails if you do not reinstall numpy
- name: Python OpenCV Test (Uninstall Numpy for OpenCV)
shell: cmd
run: |
metacall pip uninstall numpy --yes
IF %ERRORLEVEL% NEQ 0 exit /B 1

# For some reason, it needs to be split into two different steps in order to work
- name: Python OpenCV Test (Install Numpy for OpenCV)
shell: cmd
run: |
metacall pip install numpy==1.21.6
IF %ERRORLEVEL% NEQ 0 exit /B 1

- name: Python OpenCV Test (Test OpenCV)
shell: cmd
run: |
metacall ./test/opencv/opencv.py | findstr "OpenCV Version: 3.4.11"
IF %ERRORLEVEL% NEQ 0 exit /B 1

- name: Deploy & FaaS Test
shell: cmd
run: |
metacall deploy --version | findstr /R "^v.*\..*\..*"
IF %ERRORLEVEL% NEQ 0 exit /B 1
metacall faas --version | findstr /R "^v.*\..*\..*"
IF %ERRORLEVEL% NEQ 0 exit /B 1

- name: Uninstall MetaCall
shell: cmd
env:
METACALL_INSTALL_DEBUG: 1
run: |
powershell -NoProfile -ExecutionPolicy unrestricted ./install.ps1 -Uninstall

- name: Uninstall Test
shell: pwsh
run: |
$MetaCallPath = "$env:LocalAppData\MetaCall"
Write-Output "Checking MetaCall installation directory: $MetaCallPath"
If (Test-Path $MetaCallPath) {
Write-Error "MetaCall installation directory still exists"
exit 1
}
$MetaCallBinary = (Get-Command metacall -ErrorAction SilentlyContinue)
If ($MetaCallBinary) {
Write-Error "MetaCall binary is still available"
exit 2
}
Write-Output "Uninstall verification passed."
3 changes: 2 additions & 1 deletion proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ RUN apk add openssl \
&& openssl req -x509 -nodes -days 365 -subj "/C=CA/ST=QC/O=Company, Inc./CN=raw.githubusercontent.com" \
-addext "subjectAltName=DNS:raw.githubusercontent.com" -newkey rsa:2048 \
-keyout /etc/ssl/private/nginx-selfsigned.key \
-out /etc/ssl/certs/nginx-selfsigned.crt
-out /etc/ssl/certs/nginx-selfsigned.crt \
&& cat /etc/ssl/certs/nginx-selfsigned.crt >> /etc/ssl/certs/ca-certificates.crt

USER root

Expand Down
7 changes: 5 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -xuo pipefail
set -exuo pipefail

# Run with Buildkit
export DOCKER_BUILDKIT=1
Expand All @@ -36,7 +36,7 @@ METACALL_INSTALL_CERTS="${METACALL_INSTALL_CERTS:-certificates_local}"
docker build -t metacall/install_nginx -f proxy/Dockerfile .

# Stop the container if it is already running
if [ $(docker ps -f "name=metacall_install_nginx" --format '{{.Names}}') = "metacall_install_nginx" ]; then
if [ "$(docker ps -f "name=metacall_install_nginx" --format '{{.Names}}')" = "metacall_install_nginx" ]; then
docker stop metacall_install_nginx
fi

Expand All @@ -55,6 +55,9 @@ else
METACALL_INSTALL_DNS=
fi

# Disable exit on error for printing the test fails
set +e

# Run tests
for test in ${TEST_LIST}; do
docker build \
Expand Down
2 changes: 2 additions & 0 deletions test/opencv/opencv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import cv2
print("OpenCV Version", cv2.__version__)
1 change: 1 addition & 0 deletions test/opencv/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
opencv-contrib-python==3.4.11.45
Loading