Skip to content

Commit 563acb8

Browse files
authored
Merge branch 'onaio:main' into main
2 parents f903a32 + 76c503c commit 563acb8

File tree

90 files changed

+3876
-980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+3876
-980
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ concurrency:
99
jobs:
1010
static-analysis:
1111
name: Prospector Static Analysis
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-22.04
1313
env:
1414
DJANGO_SETTINGS_MODULE: onadata.settings.github_actions_test
1515
strategy:
@@ -29,11 +29,11 @@ jobs:
2929
requirements/dev.pip
3030
requirements/azure.pip
3131
32+
- name: Update apt sources
33+
run: sudo apt-get update
34+
3235
- name: Install APT requirements
33-
run: |
34-
sudo apt-get update
35-
sudo apt-get install -y --no-install-recommends libjpeg-dev zlib1g-dev software-properties-common ghostscript libxslt1-dev binutils libproj-dev gdal-bin memcached libmemcached-dev libxml2-dev libxslt-dev
36-
sudo rm -rf /var/lib/apt/lists/*
36+
run: sudo apt-get install -y --no-install-recommends libjpeg-dev zlib1g-dev software-properties-common ghostscript libxslt1-dev binutils libproj-dev gdal-bin memcached libmemcached-dev libxml2-dev libxslt-dev
3737

3838
- name: Install Pip requirements
3939
run: |
@@ -50,7 +50,7 @@ jobs:
5050
run: prospector -X -s veryhigh onadata
5151
unit-tests-1:
5252
name: Django Unit Tests (Libraries, Main, RestServices, SMS Support, Viewer, Messaging)
53-
runs-on: ubuntu-20.04
53+
runs-on: ubuntu-22.04
5454
needs: static-analysis
5555
env:
5656
DJANGO_SETTINGS_MODULE: onadata.settings.github_actions_test
@@ -90,11 +90,11 @@ jobs:
9090
requirements/dev.pip
9191
requirements/azure.pip
9292
93+
- name: Update apt sources
94+
run: sudo apt-get update
95+
9396
- name: Install APT requirements
94-
run: |
95-
sudo apt-get update
96-
sudo apt-get install -y --no-install-recommends libjpeg-dev zlib1g-dev software-properties-common ghostscript libxslt1-dev binutils libproj-dev gdal-bin memcached libmemcached-dev libxml2-dev libxslt-dev
97-
sudo rm -rf /var/lib/apt/lists/*
97+
run: sudo apt-get install -y --no-install-recommends libjpeg-dev zlib1g-dev software-properties-common ghostscript libxslt1-dev binutils libproj-dev gdal-bin memcached libmemcached-dev libxml2-dev libxslt-dev
9898

9999
- name: Install Pip requirements
100100
run: |
@@ -107,7 +107,7 @@ jobs:
107107
python manage.py test onadata/libs onadata/apps/main onadata/apps/restservice onadata/apps/sms_support onadata/apps/viewer onadata/apps/messaging --noinput --timing --settings=onadata.settings.github_actions_test --verbosity=2 --parallel=4
108108
unit-tests-2:
109109
name: Django Unit Tests (API, Logger)
110-
runs-on: ubuntu-20.04
110+
runs-on: ubuntu-22.04
111111
needs: static-analysis
112112
env:
113113
DJANGO_SETTINGS_MODULE: onadata.settings.github_actions_test
@@ -147,28 +147,32 @@ jobs:
147147
requirements/dev.pip
148148
requirements/azure.pip
149149
150+
- name: Update apt sources
151+
run: sudo apt-get update
152+
150153
- name: Install APT requirements
151-
run: |
152-
sudo apt-get update
153-
sudo apt-get install -y --no-install-recommends libjpeg-dev zlib1g-dev software-properties-common ghostscript libxslt1-dev binutils libproj-dev gdal-bin memcached libmemcached-dev libxml2-dev libxslt-dev
154-
sudo rm -rf /var/lib/apt/lists/*
154+
run: sudo apt-get install -y --no-install-recommends libjpeg-dev zlib1g-dev software-properties-common ghostscript libxslt1-dev binutils libproj-dev gdal-bin memcached libmemcached-dev libxml2-dev libxslt-dev
155155

156156
- name: Install Pip requirements
157157
run: |
158158
pip install -U pip
159159
pip install -r requirements/base.pip
160160
pip install -r requirements/dev.pip
161+
pip install -r requirements/azure.pip
161162
162163
- name: Run tests
163164
run: |
164165
python manage.py test onadata/apps/api onadata/apps/logger --noinput --timing --settings=onadata.settings.github_actions_test --verbosity=2 --parallel=4
165166
security-check:
166167
name: Trivy Security Checks
167-
runs-on: ubuntu-20.04
168+
runs-on: ubuntu-22.04
168169
steps:
169170
- name: Checkout code
170171
uses: actions/checkout@v3
171172

173+
- name: Update apt sources
174+
run: sudo apt-get update
175+
172176
- name: Get the branch name
173177
id: get-branch-name
174178
if: github.event_name == 'push'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ celerybeat.pid
4545
.virtualenv
4646
*.ropeproject
4747
.noseids
48+
.python-version
4849

4950
gunicorn_cfg.py
5051
run_gunicorn.sh

CHANGES.rst

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,88 @@ Changelog for Onadata
33

44
``* represents releases that introduce new migrations``
55

6+
v3.8.6(2023-03-07)
7+
------------------
8+
- Handle cases of duplicate metadata fields within exports
9+
`PR #2385 <https://github.com/onaio/onadata/pull/2385>`_
10+
[@DavisRayM]
11+
- Update dependencies
12+
`PR #2387 <https://github.com/onaio/onadata/pull/2387>`_
13+
[@DavisRayM]
14+
- Add backward compatibility for existing .xls form downloads
15+
`PR #2383 <https://github.com/onaio/onadata/pull/2383>`_
16+
[@KipSigei]
17+
18+
v3.8.5(2023-02-22)
19+
------------------
20+
- Fix: FieldError: Cannot resolve keyword 'json' into field from Attachment model
21+
`PR #2380 <https://github.com/onaio/onadata/pull/2380>`_
22+
[@FrankApiyo]
23+
24+
v3.8.4(2023-02-20)
25+
------------------
26+
- Fix choice labels bug on filtered dataset exports
27+
`PR #2372 <https://github.com/onaio/onadata/pull/2372>`_
28+
[@KipSigei]
29+
- Fix: Media endpoint currently returns an empty list for filtered and merged datasets
30+
`PR #2371 <https://github.com/onaio/onadata/pull/2371>`_
31+
[@FrankApiyo]
32+
33+
v3.8.3(2023-02-14)
34+
------------------
35+
- Filter out deleted submissiions from linked GeoJSON
36+
`PR #2371 <https://github.com/onaio/onadata/pull/2371>`_
37+
[@KipSigei]
38+
39+
v3.8.2(2023-02-07)
40+
------------------
41+
- Remove spaces from user-agent cached key
42+
`PR #2369 <https://github.com/onaio/onadata/pull/2369>`_
43+
[@KipSigei]
44+
- Correctly remove group name for GPS field headers for xlsx exports
45+
`PR #2364 <https://github.com/onaio/onadata/pull/2364>`_
46+
[@KipSigei]
47+
48+
v3.8.1(2023-02-03)
49+
------------------
50+
- Add custom throttling class
51+
`PR #2365 <https://github.com/onaio/onadata/pull/2365>`_
52+
[@DavisRayM]
53+
54+
v3.8.0(2023-02-01)
55+
------------------
56+
- Ensure that the user row is selected alongside the Token
57+
`PR #2362 <https://github.com/onaio/onadata/pull/2362>`_
58+
[@FrankApiyo]
59+
- Render filtered datasets and merged datasets as geojson
60+
`PR #2360 <https://github.com/onaio/onadata/pull/2360>`_
61+
[@FrankApiyo]
62+
- Fix an issue where GPS Data within a group is not correctly extracted when group name is removed
63+
`PR #2355 <https://github.com/onaio/onadata/pull/2355>`_
64+
[@DavisRayM]
65+
- Update setuptools & futures packages
66+
`PR #2353 <https://github.com/onaio/onadata/pull/2353>`_
67+
[@DavisRayM]
68+
- Ensure external select to csv conversion works as expected
69+
`PR #2349 <https://github.com/onaio/onadata/pull/2349>`_
70+
[@DavisRayM]
71+
- Return correct geojson for polygons and geotrace data
72+
`PR #2348 <https://github.com/onaio/onadata/pull/2348>`_
73+
[@FrankApiyo]
74+
- Ensure Excel exports are in .xlsx format
75+
`PR #2346 <https://github.com/onaio/onadata/pull/2346>`_
76+
[@KipSigei]
77+
- Ensure user profiles are created before building user permissions object
78+
`PR #2344 <https://github.com/onaio/onadata/pull/2344>`_
79+
[@KipSigei]
80+
81+
v3.7.1(2022-12-21)
82+
------------------
83+
84+
- Formbuilder permission changes
85+
`PR #2345 <https://github.com/onaio/onadata/pull/2345>`_
86+
[@DavisRayM]
87+
688
3.7.0(2022-12-07)
789
------------------
890
- Update GeoJSON endpoint to filter by instances with geoms

Dockerfile

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
FROM ubuntu:20.04
2+
3+
# Silence configuration prompts
4+
ENV DEBIAN_FRONTEND noninteractive
5+
ENV PYTHONUNBUFFERED 1
6+
7+
ENV DJANGO_SETTINGS_MODULE onadata.settings.docker
8+
9+
# Install service dependencies
10+
# hadolint ignore=DL3008
11+
RUN apt-get update -q &&\
12+
apt-get install -y --no-install-recommends software-properties-common \
13+
binutils \
14+
libproj-dev \
15+
gdal-bin \
16+
memcached \
17+
libmemcached-dev \
18+
build-essential \
19+
supervisor \
20+
python3.9 \
21+
python3-dev \
22+
python3-pip \
23+
python3-setuptools \
24+
git \
25+
libssl-dev \
26+
libpq-dev \
27+
gfortran \
28+
libatlas-base-dev \
29+
libjpeg-dev \
30+
libxml2-dev \
31+
libxslt1-dev \
32+
libpython3.9-dev \
33+
zlib1g-dev \
34+
ghostscript \
35+
python3-celery \
36+
python3-sphinx \
37+
pkg-config \
38+
gcc \
39+
automake \
40+
libtool \
41+
openjdk-11-jre-headless \
42+
libpcre3 \
43+
libpcre3-dev \
44+
locales \
45+
netcat && \
46+
apt-get -y -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' dist-upgrade &&\
47+
rm -rf /var/lib/apt/lists/*
48+
49+
# Generate and set en_US.UTF-8 locale
50+
RUN locale-gen en_US.UTF-8
51+
ENV LC_ALL en_US.UTF-8
52+
ENV LC_CTYPE en_US.UTF-8
53+
RUN dpkg-reconfigure locales
54+
55+
# Create OnaData user and add to tty group
56+
RUN useradd -G tty -m onadata
57+
58+
# Make app directory
59+
RUN mkdir -p /srv/onadata && chown -R onadata:onadata /srv
60+
61+
# Copy local codebase
62+
COPY . /srv/onadata
63+
64+
# Install service requirements
65+
# hadolint ignore=DL3013
66+
RUN python3.9 -m pip install --no-cache-dir -U pip && \
67+
python3.9 -m pip install --no-cache-dir -r /srv/onadata/requirements/base.pip && \
68+
python3.9 -m pip install --no-cache-dir -r /srv/onadata/requirements/s3.pip && \
69+
python3.9 -m pip install --no-cache-dir -r /srv/onadata/requirements/ses.pip && \
70+
python3.9 -m pip install --no-cache-dir -r /srv/onadata/requirements/azure.pip && \
71+
python3.9 -m pip install --no-cache-dir uwsgitop django-silk
72+
73+
WORKDIR /srv/onadata
74+
75+
EXPOSE 8000
76+
77+
USER onadata
78+
79+
CMD ["/usr/local/bin/uwsgi", "--ini", "/srv/onadata/uwsgi.ini"]

docker-compose.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
services:
2+
api:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
depends_on:
7+
- database
8+
- cache
9+
stdin_open: true
10+
tty: true
11+
user: "onadata"
12+
volumes:
13+
- ./:/srv/onadata
14+
ports:
15+
- 8000:8000
16+
command: /usr/local/bin/uwsgi --ini /srv/onadata/uwsgi.ini
17+
18+
celery:
19+
build:
20+
context: .
21+
dockerfile: Dockerfile
22+
depends_on:
23+
- database
24+
- cache
25+
- api
26+
volumes:
27+
- ./:/srv/onadata
28+
user: "onadata"
29+
command: celery -A onadata.celeryapp worker -B -l INFO -E
30+
31+
database:
32+
image: postgis/postgis:13-3.3-alpine
33+
environment:
34+
POSTGRES_PASSWORD: onadata
35+
POSTGRES_USER: onadata
36+
POSTGRES_DB: onadata
37+
volumes:
38+
- dbdata:/var/lib/postgresql/data
39+
40+
cache:
41+
image: redis:alpine
42+
43+
volumes:
44+
dbdata:

docker/onadata-uwsgi/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ RUN mkdir -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
1313
# hadolint ignore=DL3013
1414
RUN --mount=type=ssh if [ -n "$optional_packages" ]; then pip install ${optional_packages} ; fi
1515

16-
FROM ubuntu:20.04
16+
FROM ubuntu:focal-20221130
1717
COPY --from=intermediate /usr/local/lib/python3.9/site-packages/ /usr/local/lib/python3.9/dist-packages/
1818

19-
ARG release_version=v2.4.1
19+
ARG release_version=v3.7.1
2020

2121
# Silence configuration prompts
2222
ENV DEBIAN_FRONTEND noninteractive
@@ -61,7 +61,6 @@ RUN apt-get update -q &&\
6161
libpcre3-dev \
6262
locales \
6363
netcat && \
64-
apt-get -y -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' dist-upgrade &&\
6564
rm -rf /var/lib/apt/lists/*
6665

6766
# Generate and set en_US.UTF-8 locale
@@ -87,7 +86,8 @@ RUN python3.9 -m pip install --no-cache-dir -U pip && \
8786
python3.9 -m pip install --no-cache-dir -r requirements/s3.pip && \
8887
python3.9 -m pip install --no-cache-dir -r requirements/ses.pip && \
8988
python3.9 -m pip install --no-cache-dir -r requirements/azure.pip && \
90-
python3.9 -m pip install --no-cache-dir pyyaml uwsgitop django-prometheus==v2.2.0
89+
python3.9 -m pip install setuptools==65.5.1 && \
90+
python3.9 -m pip install --no-cache-dir pyyaml uwsgitop
9191

9292
# Compile API Docs
9393
RUN make -C docs html

0 commit comments

Comments
 (0)