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

Add python container to build pipeline #189

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
68 changes: 35 additions & 33 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
name: Test diplicity

on:
push:
branches: [master]
pull_request:
branches: [master]
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest
container:
image: python:2.7.18-buster
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This did not work unfortunately, when I tried it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I didn't realize you had tried this already.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it right before the other CL i mentioned you in. It didn't work because other parts of the cloud tool chain needs Python3 (!).

I got it working (up to a point) when I used apt get to install Python2.7, but then I got other errors as mentioned in that PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So at which point exactly do we need Python2.7? should we try wrapping the start and test scripts in dockerfiles? The Dockerfile I'm using for dev seems to work well.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's very strange. I think most of the gcloud toolchain runs on Python3, but the dev_appserver is something they actually want to get rid of, but so many real customers use it that they can't - but it runs on 2.7 and they don't want to invest into upgrading. Something like that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised. If you look at the Dockerfile I added, it doesn't explicitly use Python2.7 at all but it definitely brings up the API and admin apps successfully (was testing it last night).

I can't see why it works in the Dockerfile and wouldn't work in the pipeline.


steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.20'
check-latest: true
- name: Check Go version
run: go version
- name: Set up GoogleCloudPlatform
uses: google-github-actions/setup-gcloud@v0
- name: Debug log GoogleCloudPlatform info
run: gcloud info
- name: Install App Engine Go
run: gcloud components install app-engine-go
- name: Extract GoogleCloudPlatform installation root
run: echo "GCLOUD_ROOT=$(gcloud info | grep 'Installation Root:' | sed -e 's/.*\[\([^]]\+\).*/\1/')" >> $GITHUB_ENV
- name: Check out code
uses: actions/checkout@v2
- name: Set up Python2.7
uses: actions/setup-python@v4
id: setup-python2
with:
python-version: 2.7
- name: Start test server
run: ${GITHUB_WORKSPACE}/diptest/start_test_server.sh
- name: Run tests
run: cd diptest && go test -v -timeout 40m
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
check-latest: true
- name: Check Go version
run: go version
- name: Set up GoogleCloudPlatform
uses: google-github-actions/setup-gcloud@v0
- name: Debug log GoogleCloudPlatform info
run: gcloud info
- name: Install App Engine Go
run: gcloud components install app-engine-go
- name: Extract GoogleCloudPlatform installation root
run: echo "GCLOUD_ROOT=$(gcloud info | grep 'Installation Root:' | sed -e 's/.*\[\([^]]\+\).*/\1/')" >> $GITHUB_ENV
- name: Check out code
uses: actions/checkout@v2
- name: Set up Python2.7
uses: actions/setup-python@v4
id: setup-python2
with:
python-version: 2.7
- name: Start test server
run: ${GITHUB_WORKSPACE}/diptest/start_test_server.sh
- name: Run tests
run: cd diptest && go test -v -timeout 40m
Loading