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

deps: upgrade base image to noble #782

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ release-version: .env
$(ENVREPLACE) TEST_BASIC_AUTH_PASSWORD $$(openssl rand -base64 42) .env

.PHONY: docker-compose.yml
docker-compose.yml: base.yml dev.yml staging.yml prod.yml config.mk $(PGPASS_PATH) release-version
docker-compose.yml: base.yml dev.yml staging.yml prod.yml config.mk $(PGPASS_PATH) release-version .env
case "$(DEPLOY_ENVIRONMENT)" in \
dev|staging) docker compose -f base.yml -f $(DEPLOY_ENVIRONMENT).yml config > docker-compose.yml;; \
prod) docker compose -f base.yml -f staging.yml -f $(DEPLOY_ENVIRONMENT).yml config > docker-compose.yml;; \
Expand All @@ -100,7 +100,7 @@ secrets: $(SECRETS_DIR) $(GENERATED_SECRETS)
done

.PHONY: deploy
deploy: build .env
deploy: build
docker compose pull db redis elasticsearch
ifneq ($(DEPLOY_ENVIRONMENT),dev)
docker compose pull nginx
Expand Down
5 changes: 3 additions & 2 deletions deploy/conf/.env.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Docker build
# UBUNTU_MIRROR=mirror.arizona.edu
VIRTUAL_ENV=/home/comses/virtualenvs/comses.venv
UBUNTU_MIRROR=archive.ubuntu.com
# set PATH defaults for cron execution
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PATH="${VIRTUAL_ENV}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# app settings
RELEASE_VERSION=
Expand All @@ -21,7 +22,7 @@ DISCOURSE_BASE_URL=
DISCOURSE_API_USERNAME=

# elastic search
ES_VERSION=7.17.22
ES_VERSION=7.17.26

# email
EMAIL_SUBJECT_PREFIX="[CoMSES Net]"
Expand Down
5 changes: 4 additions & 1 deletion django/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM comses/base:jammy
FROM comses/base:noble

ARG REQUIREMENTS_FILE=requirements-dev.txt
ARG RUN_SCRIPT=./deploy/dev.sh
ARG UBUNTU_MIRROR=archive.ubuntu.com
ENV VIRTUAL_ENV=/home/comses/virtualenvs/comses.venv
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"

RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/lib/apt,sharing=locked \
Expand Down Expand Up @@ -39,6 +41,7 @@ RUN --mount=type=cache,target=/var/lib/apt,sharing=locked \
unrar-free \
unzip \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 1000 \
&& python -m venv ${VIRTUAL_ENV} \
&& apt-get upgrade -q -y -o Dpkg::Options::="--force-confold" \
&& mkdir -p /etc/service/django \
&& touch /etc/service/django/run /etc/postgresql-backup-pre \
Expand Down
2 changes: 1 addition & 1 deletion django/core/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def test_mark_spam(self):
)
event.refresh_from_db()
# non-moderators cannot mark content as spam
self.assertEquals(response.status_code, 403)
self.assertEqual(response.status_code, 403)
self.assertFalse(event.is_marked_spam)
# check moderator
self.client.login(
Expand Down
6 changes: 3 additions & 3 deletions django/home/tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ def test_convert_timeseries(self):
)
for chart_data in highcharts_timeseries:
# 2012 and 2013 should also be 0
self.assertEquals(
self.assertEqual(
tuple(chart_data["data"][0:2]),
(0, 0),
"2012-13 should be zeroed out",
)
# missing year 2016
self.assertEquals(
self.assertEqual(
chart_data["data"][4],
0,
f"5th entry (2016) should be 0 {chart_data['name']}",
)
self.assertTrue(
chart_data["name"] in OS_NAMES, f"Invalid OS name {chart_data['name']}"
)
self.assertEquals(len(chart_data["data"]), 7, "Should be 7 years of data")
self.assertEqual(len(chart_data["data"]), 7, "Should be 7 years of data")
2 changes: 1 addition & 1 deletion django/library/tests/test_datacite_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_mint_new_doi_for_release(self):
self.assertTrue(self.api.is_datacite_available())
release = self.codebase.releases.first()
log, ok = self.api.mint_public_doi(release)
self.assertEquals(log.http_status, 200, "should have successfully minted a DOI")
self.assertEqual(log.http_status, 200, "should have successfully minted a DOI")
self.assertTrue(self.api.doi_matches_pattern(doi))

def test_update_metadata_for_release(self):
Expand Down
8 changes: 4 additions & 4 deletions django/library/tests/test_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def test_zipfile_saving(self):
fs_api=fs_api,
)
logs, level = msgs.serialize()
self.assertEquals(level, MessageLevels.warning)
self.assertEquals(len(logs), 2)
self.assertEqual(level, MessageLevels.warning)
self.assertEqual(len(logs), 2)
self.assertEqual(
set(
fs_api.list(StagingDirectories.originals, FileCategoryDirectories.code)
Expand Down Expand Up @@ -77,8 +77,8 @@ def test_invalid_zipfile_saving(self):
FileCategoryDirectories.code, content=f, name="invalid.zip"
)
logs, level = msgs.serialize()
self.assertEquals(level, MessageLevels.error)
self.assertEquals(len(logs), 1)
self.assertEqual(level, MessageLevels.error)
self.assertEqual(len(logs), 1)

@classmethod
def tearDownClass(cls):
Expand Down
8 changes: 4 additions & 4 deletions django/library/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def setUp(self):
)

def test_base_dir(self):
self.assertEquals(
self.assertEqual(
self.c1.base_library_dir,
pathlib.Path(settings.LIBRARY_ROOT, str(self.c1.uuid)),
)
self.assertEquals(
self.assertEqual(
self.c1.base_git_dir,
pathlib.Path(settings.REPOSITORY_ROOT, str(self.c1.uuid)),
)
Expand All @@ -43,8 +43,8 @@ def test_create_release(self):
release = ReleaseSetup.setUpPublishableDraftRelease(self.c1)
release.validate_publishable()
release.publish()
self.assertEquals(self.c1.latest_version, release)
self.assertEquals(
self.assertEqual(self.c1.latest_version, release)
self.assertEqual(
CodebaseRelease.objects.get(
codebase=self.c1, version_number=release.version_number
),
Expand Down
1 change: 1 addition & 0 deletions django/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ elasticsearch>=7.0.0,<8.0.0
html2text>=2016.9.19
jinja2==3.1.4
jsonschema==4.23.0
jwt==1.3.1 # needed for allauth
markdown==3.7
nltk>=3.8.1,<4.0.0
numpy==1.26.4
Expand Down
Loading