Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 0c10db47c1a4bd41eea30636c5840655595ba99d
Author: andrew-canaday <andrew.canaday@gmail.com>
Date:   Sat Jul 15 13:47:44 2023 -0400

    Minor tweaks to docker build + HTTP test.

commit df68b7ea95607b8fc0905b7ce70dc15b08595287
Author: andrew-canaday <andrew.canaday@gmail.com>
Date:   Sat Jul 15 13:46:20 2023 -0400

    WSGI: PORT and CONTENT_LENGTH should be string, not int.

commit 2df2a0fc6ce201e3d2ef4fad1dc3915802829046
Author: andrew-canaday <andrew.canaday@gmail.com>
Date:   Sat Jul 15 09:27:58 2023 -0400

    Add start_server script for local debug

commit d91e6689f405ab9f3a5cb4b36b9c23189eab0f9a
Author: andrew-canaday <andrew.canaday@gmail.com>
Date:   Thu Jul 13 07:50:03 2023 -0400

    Use actions checkout/v3

commit d3f8fffe20bc08240a70c6325dcb67c02dfcea80
Author: andrew-canaday <andrew.canaday@gmail.com>
Date:   Thu Jul 13 07:45:36 2023 -0400

    Switch to v2 of docker login action

commit 376f612440bc7ff77d0e8c3a06e3600bee7a6e96
Author: andrew-canaday <andrew.canaday@gmail.com>
Date:   Mon Apr 3 10:01:41 2023 -0400

    Update pytest for CI

commit c73c63b0e31e2e8ad8658550a59ea75c7166f811
Author: andrew-canaday <andrew.canaday@gmail.com>
Date:   Wed Mar 29 07:56:57 2023 -0400

    Empty commit to prompt CI post RSA key change.

commit c09d442a5c4878aec4a7e8e7b186b7e8c3dc5ece
Author: andrew-canaday <andrew.canaday@gmail.com>
Date:   Sat Jul 30 20:39:23 2022 -0400

    Fmt code
  • Loading branch information
andrew-canaday committed Jul 15, 2023
1 parent 3f1a57a commit bb141c7
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/configure_make_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# Dependencies:
#------------------------------------
- name: Checkout libbsat
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'andrew-canaday/libbsat'
path: 'libbsat'
Expand All @@ -49,7 +49,7 @@ jobs:
# Checkout, configure, make, run tests, and make dist for libyimmo:
#--------------------------------------------------------------------
- name: Checkout libyimmo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
path: 'libyimmo'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/create_release_on_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# Dependencies:
#------------------------------------
- name: Checkout libbsat
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'andrew-canaday/libbsat'
path: 'libbsat'
Expand All @@ -55,7 +55,7 @@ jobs:
# - signing
#--------------------------------------------------------------------
- name: Checkout libyimmo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: ${{ github.repository }}
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
shell: bash
steps:
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker_wsgi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
shell: bash
steps:
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/server-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
IMAGE_NAME: "ghcr.io/${{ github.repository }}-ci:${{ github.ref_name }}"
steps:
- name: Checkout libyimmo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
path: 'libyimmo'
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
IMAGE_NAME: "ghcr.io/${{ github.repository }}-ci:${{ github.ref_name }}"
steps:
- name: Checkout libyimmo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
path: 'libyimmo'
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
IMAGE_NAME: "ghcr.io/${{ github.repository }}-ci:${{ github.ref_name }}"
steps:
- name: Checkout libyimmo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
path: 'libyimmo'
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
IMAGE_NAME: "ghcr.io/${{ github.repository }}-ci:${{ github.ref_name }}"
steps:
- name: Checkout libyimmo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
path: 'libyimmo'
Expand Down Expand Up @@ -262,7 +262,7 @@ jobs:
IMAGE_NAME: "ghcr.io/${{ github.repository }}-ci:${{ github.ref_name }}"
steps:
- name: Checkout libyimmo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
path: 'libyimmo'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# Dependencies:
#------------------------------------
- name: Checkout libbsat
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'andrew-canaday/libbsat'
path: 'libbsat'
Expand All @@ -53,7 +53,7 @@ jobs:
# Build libyimmo:
#--------------------------------------------------------------------
- name: Checkout libyimmo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
path: 'libyimmo'
Expand Down
2 changes: 1 addition & 1 deletion ci/http/test_http_1_0_basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ test_expect_100_continue() {
EXPECT_STATUS="200" \
ctest -0 \
-H 'Expect: 100-continue' \
--data-binary "${0}" \
--data-binary "@${0}" \
"${YMO_HTTP_TEST_URL_ROOT}/echo/body"
}

Expand Down
13 changes: 13 additions & 0 deletions ci/start-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

IMAGE_NAME="${IMAGE_NAME:-"yimmo-ci-test:local"}"

docker run \
--name yimmo-wsgi-server \
-e YIMMO_LOG_LEVEL=${YIMMO_LOG_LEVEL:-"INFO"} \
-e YIMMO_WSGI_NO_PROC=2 \
-e YIMMO_WSGI_NO_THREADS=2 \
-p 8081:8081 \
$IMAGE_NAME

# EOF
9 changes: 5 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ RUN apt-get -qq install -y \

RUN pip3 install flask

ADD . /opt/src/libyimmo
RUN cd /opt/src && git clone https://github.com/andrew-canaday/libbsat
RUN cd /opt/src/libbsat && ./autogen.sh
RUN cd /opt/src/libyimmo && ./autogen.sh

RUN cd /opt/build/bsat \
&& /opt/src/libbsat/configure \
--silent \
--enable-silent-rules \
&& make install

ADD . /opt/src/libyimmo
RUN cd /opt/src/libyimmo && ./autogen.sh


#-------------------------------------------------------------------------------
# Test base:
Expand All @@ -59,7 +59,8 @@ FROM yimmo-deps AS yimmo-test
ENV YIMMO_SERVER_IDLE_TIMEOUT=2.0
RUN cd /opt/build/yimmo \
&& /opt/src/libyimmo/configure \
--enable-examples --enable-wsgi \
--enable-examples \
--enable-wsgi \
CFLAGS="-DYMO_LOG_LEVEL_MAX=6 -DYMO_LOG_LEVEL_DEFAULT=3" \
YMO_WS_FRAME_MAX=0xffffffffffffffff \
&& make \
Expand Down
2 changes: 1 addition & 1 deletion wsgi/ymo_wsgi_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ yimmo_context_t* ymo_wsgi_ctx_update_environ(PyObject* pEnviron, ymo_wsgi_exchan
}
if( request->content_length ) {
YMO_DECREF_PYDICT_SETITEM(pEnviron, pEnvironKeyContentLength,
PyLong_FromSize_t(request->content_length));
PyUnicode_FromFormat("%zu", request->content_length));
}
ymo_wsgi_ctx_update_bail:
ymo_wsgi_session_unlock(exchange->session);
Expand Down
6 changes: 4 additions & 2 deletions wsgi/ymo_wsgi_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,11 @@ ymo_status_t ymo_wsgi_init(ymo_wsgi_proc_t* w_proc)

/* PEP 3333: */
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SERVER_NAME", PyUnicode_FromString("yimmo-wsgi"));
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SERVER_PORT", PyLong_FromLong(w_proc->port));
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SERVER_PORT", PyUnicode_FromFormat("%i", w_proc->port));
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SERVER_PROTOCOL", pUrlScheme);
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SCRIPT_NAME", PyUnicode_FromString(w_proc->module));

/* TODO: set from env? */
//YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SCRIPT_NAME", PyUnicode_FromString(w_proc->module));

YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "wsgi.version", pWsgiVersion);
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "wsgi.errors", pStderr); /* HACK! */
Expand Down

0 comments on commit bb141c7

Please sign in to comment.