Skip to content

Commit

Permalink
Merge pull request #52 from fiaas/ubuntu2004-ci-image
Browse files Browse the repository at this point in the history
Use python 3.9 and ubuntu2004 CI image
  • Loading branch information
oyvindio authored Feb 7, 2024
2 parents f5356fa + 825dbd3 commit 65b0118
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Mast docker build
agent:
machine:
type: e1-standard-4
os_image: ubuntu1804
os_image: ubuntu2004
blocks:
- name: build
task:
Expand All @@ -17,7 +17,7 @@ blocks:
- name: build
commands:
- checkout
- sem-version python 3.6
- sem-version python 3.9
- cache restore ${SEMAPHORE_GIT_BRANCH}-pip
- pip install --quiet --no-color .[ci]
- cache delete ${SEMAPHORE_GIT_BRANCH}-pip
Expand All @@ -43,7 +43,7 @@ blocks:
- name: deploy
commands:
- checkout
- sem-version python 3.6
- sem-version python 3.9
- git config --global user.email "semaphore@example.org"
- git config --global user.name "Semaphore CI"
- cache restore ${SEMAPHORE_GIT_BRANCH}-${SEMAPHORE_WORKFLOW_ID}-build
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM python:3.6-alpine3.7 as common
FROM python:3.9-alpine3.19 as common
LABEL maintainer="fiaas <fiaas@googlegroups.com>"

RUN apk --no-cache add --update ca-certificates tini=0.16.1-r0 yaml && \
RUN apk --no-cache add --update ca-certificates tini=0.19.0-r2 yaml && \
mkdir -p /opt/fiaas-mast && \
adduser -u 10001 -D -h /opt/fiaas-mast fiaas-mast

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Kubernetes cluster.
Development
-----------

The Development target is Python 3.6.
The Development target is Python 3.9.

Install dependencies using `pip`:

Expand Down
25 changes: 12 additions & 13 deletions fiaas_mast/fiaas.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

from __future__ import absolute_import

import six
from k8s.base import Model
from k8s.fields import Field, RequiredField, ListField
from k8s.models.common import ObjectMeta
Expand All @@ -34,8 +33,8 @@ class AdditionalLabelsOrAnnotations(Model):


class FiaasApplicationSpec(Model):
application = RequiredField(six.text_type)
image = RequiredField(six.text_type)
application = RequiredField(str)
image = RequiredField(str)
config = RequiredField(dict)
additional_labels = Field(AdditionalLabelsOrAnnotations)
additional_annotations = Field(AdditionalLabelsOrAnnotations)
Expand All @@ -47,8 +46,8 @@ class Meta:
watch_list_url = "/apis/fiaas.schibsted.io/v1/watch/applications"

# Workaround for https://github.com/kubernetes/kubernetes/issues/44182
apiVersion = Field(six.text_type, "fiaas.schibsted.io/v1")
kind = Field(six.text_type, "Application")
apiVersion = Field(str, "fiaas.schibsted.io/v1")
kind = Field(str, "Application")

metadata = Field(ObjectMeta)
spec = Field(FiaasApplicationSpec)
Expand All @@ -60,22 +59,22 @@ class Meta:
url_template = "/apis/fiaas.schibsted.io/v1/namespaces/{namespace}/statuses/{name}"

# Workaround for https://github.com/kubernetes/kubernetes/issues/44182
apiVersion = Field(six.text_type, "fiaas.schibsted.io/v1")
kind = Field(six.text_type, "Status")
apiVersion = Field(str, "fiaas.schibsted.io/v1")
kind = Field(str, "Status")

metadata = Field(ObjectMeta)
result = Field(six.text_type)
logs = ListField(six.text_type)
result = Field(str)
logs = ListField(str)


class FiaasApplicationStatus(Model):
class Meta:
url_template = "/apis/fiaas.schibsted.io/v1/namespaces/{namespace}/application-statuses/{name}"

# Workaround for https://github.com/kubernetes/kubernetes/issues/44182
apiVersion = Field(six.text_type, "fiaas.schibsted.io/v1")
kind = Field(six.text_type, "ApplicationStatus")
apiVersion = Field(str, "fiaas.schibsted.io/v1")
kind = Field(str, "ApplicationStatus")

metadata = Field(ObjectMeta)
result = Field(six.text_type)
logs = ListField(six.text_type)
result = Field(str)
logs = ListField(str)
14 changes: 8 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ def version():
"Flask==1.1.1",
"flask-talisman==0.7.0",
"flask-bootstrap==3.3.7.1",
"itsdangerous==2.0.1", # pinned for Flask 1.x
"jinja2==3.0.3", # pinned for flask 1.x
"markupsafe==2.0.1", # pinned for flask 1.x
"werkzeug==2.0.3", # pinned for flask 1.x
"pyyaml>=5.4",
"requests==2.22.0",
"six==1.12.0",
"requests==2.31.0",
"urllib3==1.26.17",
"ipaddress==1.0.22",
"k8s==0.21.0",
"k8s==0.24.2",
"prometheus_client == 0.7.1",
]

Expand All @@ -52,12 +56,10 @@ def version():
]

CI_REQ = [
"tox==3.13.2",
"tox-travis==0.12",
"tox==3.28.0",
]

TEST_REQ = [
'mock==3.0.5',
'pytest-sugar==0.9.2',
'pytest==3.10.1',
"pytest-cov==2.7.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import pytest
from k8s.client import NotFound
from mock import patch
from unittest.mock import patch

from fiaas_mast.common import check_models, PlatformError
from fiaas_mast.fiaas import FiaasApplication, FiaasApplicationSpec
Expand Down
2 changes: 1 addition & 1 deletion tests/test_deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import pytest
import yaml
from k8s.models.common import ObjectMeta
from mock import MagicMock, patch
from unittest.mock import MagicMock, patch

from fiaas_mast.deployer import generate_random_uuid_string, Deployer
from fiaas_mast.fiaas import FiaasApplicationSpec, FiaasApplication
Expand Down
4 changes: 2 additions & 2 deletions tests/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import mock
from unittest import mock
import pytest
from mock import MagicMock
from unittest.mock import MagicMock

from fiaas_mast.application_generator import ApplicationGenerator
from fiaas_mast.common import generate_random_uuid_string
Expand Down
2 changes: 1 addition & 1 deletion tests/test_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# limitations under the License.


import mock
from unittest import mock
import os.path
import pytest
import yaml
Expand Down
2 changes: 1 addition & 1 deletion tests/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from json import loads, dumps
from urllib.parse import urlparse

import mock
from unittest import mock
import pytest

from fiaas_mast.app import create_app
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[tox]
envlist = py36
envlist = py39
skip_missing_interpreters=True

[testenv]
Expand Down

0 comments on commit 65b0118

Please sign in to comment.