Skip to content

Commit c14ee12

Browse files
committed
temp: rebasing
1 parent de81095 commit c14ee12

File tree

11 files changed

+190
-183
lines changed

11 files changed

+190
-183
lines changed

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: 2
88
build:
99
os: "ubuntu-20.04"
1010
tools:
11-
python: "3.8"
11+
python: "3.11"
1212

1313
# Build documentation in the docs/ directory with Sphinx
1414
sphinx:

Dockerfile

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
FROM ubuntu:focal as base
2+
3+
# System requirements.
4+
5+
# pkg-config; mysqlclient>=2.2.0 requires pkg-config (https://github.com/PyMySQL/mysqlclient/issues/620)
6+
7+
RUN apt update && \
8+
DEBIAN_FRONTEND=noninteractive apt-get install -qy \
9+
curl \
10+
vim \
11+
language-pack-en \
12+
build-essential \
13+
python3.11-dev \
14+
python3-virtualenv \
15+
python3.11-distutils \
16+
libmysqlclient-dev \
17+
pkg-config \
18+
libssl-dev && \
19+
rm -rf /var/lib/apt/lists/*
20+
21+
# Use UTF-8.
22+
RUN locale-gen en_US.UTF-8
23+
ENV LANG en_US.UTF-8
24+
ENV LANGUAGE en_US:en
25+
ENV LC_ALL en_US.UTF-8
26+
27+
ARG COMMON_APP_DIR="/edx/app"
28+
ARG ANALYTICS_API_SERVICE_NAME="analytics_api"
29+
ENV ANALYTICS_API_HOME "${COMMON_APP_DIR}/${ANALYTICS_API_SERVICE_NAME}"
30+
ARG ANALYTICS_API_APP_DIR="${COMMON_APP_DIR}/${ANALYTICS_API_SERVICE_NAME}"
31+
ARG ANALYTICS_API_VENV_DIR="${COMMON_APP_DIR}/${ANALYTICS_API_SERVICE_NAME}/venvs/${ANALYTICS_API_SERVICE_NAME}"
32+
ARG ANALYTICS_API_CODE_DIR="${ANALYTICS_API_APP_DIR}/${ANALYTICS_API_SERVICE_NAME}"
33+
34+
ENV ANALYTICS_API_CODE_DIR="${ANALYTICS_API_CODE_DIR}"
35+
ENV PATH "${ANALYTICS_API_VENV_DIR}/bin:$PATH"
36+
ENV COMMON_CFG_DIR "/edx/etc"
37+
ENV ANALYTICS_API_CFG "/edx/etc/${ANALYTICS_API_SERVICE_NAME}.yml"
38+
39+
# Working directory will be root of repo.
40+
WORKDIR ${ANALYTICS_API_CODE_DIR}
41+
42+
RUN virtualenv -p python3.11 --always-copy ${ANALYTICS_API_VENV_DIR}
43+
44+
# Expose canonical Analytics port
45+
EXPOSE 19001
46+
47+
FROM base as prod
48+
49+
ENV DJANGO_SETTINGS_MODULE "analyticsdataserver.settings.production"
50+
51+
COPY requirements/production.txt ${ANALYTICS_API_CODE_DIR}/requirements/production.txt
52+
53+
RUN pip install -r ${ANALYTICS_API_CODE_DIR}/requirements/production.txt
54+
55+
# Copy over rest of code.
56+
# We do this AFTER requirements so that the requirements cache isn't busted
57+
# every time any bit of code is changed.
58+
59+
COPY . .
60+
61+
# exec /edx/app/analytics_api/venvs/analytics_api/bin/gunicorn -c /edx/app/analytics_api/analytics_api_gunicorn.py analyticsdataserver.wsgi:application
62+
63+
CMD ["gunicorn" , "-b", "0.0.0.0:8100", "--pythonpath", "/edx/app/analytics_api/analytics_api","analyticsdataserver.wsgi:application"]
64+
65+
FROM base as dev
66+
67+
ENV DJANGO_SETTINGS_MODULE "analyticsdataserver.settings.devstack"
68+
69+
COPY requirements/dev.txt ${ANALYTICS_API_CODE_DIR}/requirements/dev.txt
70+
71+
RUN pip install -r ${ANALYTICS_API_CODE_DIR}/requirements/dev.txt
72+
73+
# Copy over rest of code.
74+
# We do this AFTER requirements so that the requirements cache isn't busted
75+
# every time any bit of code is changed.
76+
COPY . .
77+
78+
# Devstack related step for backwards compatibility
79+
RUN touch /edx/app/${ANALYTICS_API_SERVICE_NAME}/${ANALYTICS_API_SERVICE_NAME}_env
80+
81+
CMD while true; do python ./manage.py runserver 0.0.0.0:8110; sleep 2; done

requirements/base.txt

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.8
2+
# This file is autogenerated by pip-compile with Python 3.11
33
# by the following command:
44
#
55
# make upgrade
@@ -9,16 +9,11 @@ asgiref==3.8.1
99
# django
1010
# django-cors-headers
1111
# django-countries
12-
backports-zoneinfo==0.2.1 ; python_version < "3.9"
13-
# via
14-
# -c requirements/constraints.txt
15-
# django
16-
# djangorestframework
1712
boto==2.49.0
1813
# via -r requirements/base.in
19-
boto3==1.37.5
14+
boto3==1.37.7
2015
# via -r requirements/base.in
21-
botocore==1.37.5
16+
botocore==1.37.7
2217
# via
2318
# boto3
2419
# s3transfer
@@ -60,7 +55,7 @@ django==4.2.19
6055
# edx-drf-extensions
6156
# edx-enterprise-data
6257
# edx-rbac
63-
django-cors-headers==4.4.0
58+
django-cors-headers==4.7.0
6459
# via -r requirements/base.in
6560
django-countries==7.6.1
6661
# via -r requirements/base.in
@@ -70,7 +65,7 @@ django-crum==0.7.9
7065
# edx-rbac
7166
django-fernet-fields-v2==0.9
7267
# via edx-enterprise-data
73-
django-filter==24.3
68+
django-filter==25.1
7469
# via edx-enterprise-data
7570
django-model-utils==5.0.0
7671
# via
@@ -139,29 +134,27 @@ edx-rest-api-client==6.1.0
139134
# edx-enterprise-data
140135
factory-boy==3.3.3
141136
# via edx-enterprise-data
142-
faker==35.2.2
137+
faker==36.2.2
143138
# via factory-boy
144139
html5lib==1.1
145140
# via -r requirements/base.in
146141
idna==3.10
147142
# via requests
148-
importlib-metadata==8.5.0
149-
# via markdown
150143
inflection==0.5.1
151144
# via drf-yasg
152145
itypes==1.2.0
153146
# via coreapi
154-
jinja2==3.1.5
147+
jinja2==3.1.6
155148
# via coreschema
156149
jmespath==1.0.1
157150
# via
158151
# boto3
159152
# botocore
160153
markdown==3.7
161154
# via -r requirements/base.in
162-
markupsafe==2.1.5
155+
markupsafe==3.0.2
163156
# via jinja2
164-
mysql-connector-python==9.0.0
157+
mysql-connector-python==9.2.0
165158
# via edx-enterprise-data
166159
newrelic==10.6.0
167160
# via edx-django-utils
@@ -181,21 +174,20 @@ psutil==7.0.0
181174
# via edx-django-utils
182175
pycparser==2.22
183176
# via cffi
184-
pyjwt[crypto]==2.9.0
177+
pyjwt[crypto]==2.10.1
185178
# via
186179
# drf-jwt
187180
# edx-drf-extensions
188181
# edx-rest-api-client
189182
pymemcache==4.0.0
190183
# via -r requirements/base.in
191-
pymongo==4.10.1
184+
pymongo==4.11.2
192185
# via edx-opaque-keys
193186
pynacl==1.5.0
194187
# via edx-django-utils
195188
python-dateutil==2.9.0.post0
196189
# via
197190
# botocore
198-
# faker
199191
# pandas
200192
python-memcached==1.62
201193
# via -r requirements/base.in
@@ -215,7 +207,7 @@ requests==2.32.3
215207
# edx-rest-api-client
216208
rules==3.5
217209
# via edx-enterprise-data
218-
s3transfer==0.11.3
210+
s3transfer==0.11.4
219211
# via boto3
220212
semantic-version==2.10.0
221213
# via edx-drf-extensions
@@ -228,20 +220,20 @@ six==1.17.0
228220
# python-dateutil
229221
sqlparse==0.5.3
230222
# via django
231-
stevedore==5.3.0
223+
stevedore==5.4.1
232224
# via
233225
# edx-django-utils
234226
# edx-opaque-keys
235227
tqdm==4.67.1
236228
# via -r requirements/base.in
237229
typing-extensions==4.12.2
238230
# via
239-
# asgiref
240231
# django-countries
241232
# edx-opaque-keys
242-
# faker
243233
tzdata==2025.1
244-
# via pandas
234+
# via
235+
# faker
236+
# pandas
245237
uritemplate==4.1.1
246238
# via
247239
# coreapi
@@ -254,8 +246,6 @@ urllib3==1.26.20
254246
# requests
255247
webencodings==0.5.1
256248
# via html5lib
257-
zipp==3.20.2
258-
# via importlib-metadata
259249

260250
# The following packages are considered to be unsafe in a requirements file:
261251
# setuptools

requirements/ci.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.8
2+
# This file is autogenerated by pip-compile with Python 3.11
33
# by the following command:
44
#
55
# make upgrade

requirements/dev.txt

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.8
2+
# This file is autogenerated by pip-compile with Python 3.11
33
# by the following command:
44
#
55
# make upgrade
@@ -9,16 +9,11 @@ asgiref==3.8.1
99
# django
1010
# django-cors-headers
1111
# django-countries
12-
backports-zoneinfo==0.2.1 ; python_version < "3.9"
13-
# via
14-
# -c requirements/constraints.txt
15-
# django
16-
# djangorestframework
1712
boto==2.49.0
1813
# via -r requirements/base.in
19-
boto3==1.37.5
14+
boto3==1.37.7
2015
# via -r requirements/base.in
21-
botocore==1.37.5
16+
botocore==1.37.7
2217
# via
2318
# boto3
2419
# s3transfer
@@ -60,7 +55,7 @@ django==4.2.19
6055
# edx-drf-extensions
6156
# edx-enterprise-data
6257
# edx-rbac
63-
django-cors-headers==4.4.0
58+
django-cors-headers==4.7.0
6459
# via -r requirements/base.in
6560
django-countries==7.6.1
6661
# via -r requirements/base.in
@@ -70,7 +65,7 @@ django-crum==0.7.9
7065
# edx-rbac
7166
django-fernet-fields-v2==0.9
7267
# via edx-enterprise-data
73-
django-filter==24.3
68+
django-filter==25.1
7469
# via edx-enterprise-data
7570
django-model-utils==5.0.0
7671
# via
@@ -139,29 +134,27 @@ edx-rest-api-client==6.1.0
139134
# edx-enterprise-data
140135
factory-boy==3.3.3
141136
# via edx-enterprise-data
142-
faker==35.2.2
137+
faker==36.2.2
143138
# via factory-boy
144139
html5lib==1.1
145140
# via -r requirements/base.in
146141
idna==3.10
147142
# via requests
148-
importlib-metadata==8.5.0
149-
# via markdown
150143
inflection==0.5.1
151144
# via drf-yasg
152145
itypes==1.2.0
153146
# via coreapi
154-
jinja2==3.1.5
147+
jinja2==3.1.6
155148
# via coreschema
156149
jmespath==1.0.1
157150
# via
158151
# boto3
159152
# botocore
160153
markdown==3.7
161154
# via -r requirements/base.in
162-
markupsafe==2.1.5
155+
markupsafe==3.0.2
163156
# via jinja2
164-
mysql-connector-python==9.0.0
157+
mysql-connector-python==9.2.0
165158
# via edx-enterprise-data
166159
mysqlclient==2.2.7
167160
# via -r requirements/dev.in
@@ -183,21 +176,20 @@ psutil==7.0.0
183176
# via edx-django-utils
184177
pycparser==2.22
185178
# via cffi
186-
pyjwt[crypto]==2.9.0
179+
pyjwt[crypto]==2.10.1
187180
# via
188181
# drf-jwt
189182
# edx-drf-extensions
190183
# edx-rest-api-client
191184
pymemcache==4.0.0
192185
# via -r requirements/base.in
193-
pymongo==4.10.1
186+
pymongo==4.11.2
194187
# via edx-opaque-keys
195188
pynacl==1.5.0
196189
# via edx-django-utils
197190
python-dateutil==2.9.0.post0
198191
# via
199192
# botocore
200-
# faker
201193
# pandas
202194
python-memcached==1.62
203195
# via -r requirements/base.in
@@ -217,7 +209,7 @@ requests==2.32.3
217209
# edx-rest-api-client
218210
rules==3.5
219211
# via edx-enterprise-data
220-
s3transfer==0.11.3
212+
s3transfer==0.11.4
221213
# via boto3
222214
semantic-version==2.10.0
223215
# via edx-drf-extensions
@@ -230,20 +222,20 @@ six==1.17.0
230222
# python-dateutil
231223
sqlparse==0.5.3
232224
# via django
233-
stevedore==5.3.0
225+
stevedore==5.4.1
234226
# via
235227
# edx-django-utils
236228
# edx-opaque-keys
237229
tqdm==4.67.1
238230
# via -r requirements/base.in
239231
typing-extensions==4.12.2
240232
# via
241-
# asgiref
242233
# django-countries
243234
# edx-opaque-keys
244-
# faker
245235
tzdata==2025.1
246-
# via pandas
236+
# via
237+
# faker
238+
# pandas
247239
uritemplate==4.1.1
248240
# via
249241
# coreapi
@@ -256,8 +248,6 @@ urllib3==1.26.20
256248
# requests
257249
webencodings==0.5.1
258250
# via html5lib
259-
zipp==3.20.2
260-
# via importlib-metadata
261251

262252
# The following packages are considered to be unsafe in a requirements file:
263253
# setuptools

0 commit comments

Comments
 (0)