Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Setup Travis CI & GCP project on fork #511

Open
derekherman opened this issue Jun 7, 2020 · 14 comments
Open

Setup Travis CI & GCP project on fork #511

derekherman opened this issue Jun 7, 2020 · 14 comments

Comments

@derekherman
Copy link

I have forked this repository to start contributing some fixes, mainly updating PHP, and have run into a few problems. Without a passing build I am hesitant to submit any PRs to address issues. Could someone please help me get my fork working correctly so I can contribute to this project?

  1. PR Update check_versions.sh #510 needs to be merged else the build fails to run.

    +gcloud -q container builds submit --tag gcr.io/[secure]/php-test-runner:travis-695561133 cloudbuild-test-runner
    Maybe you meant:
      gcloud run deploy
      gcloud run domain-mappings create
      gcloud run domain-mappings delete
      gcloud run domain-mappings describe
      gcloud run domain-mappings list
      gcloud run revisions delete
      gcloud run revisions describe
      gcloud run revisions list
      gcloud run services add-iam-policy-binding
      gcloud run services delete
    To search the help text of gcloud commands, run:
      gcloud help -- SEARCH_TERMS
    The command "scripts/check_versions.sh" exited with 2.
    
  2. The value for TAG is unclear, define TAG in this context.

    Also set TAG to a version name you want to use for e2e testing.
    
  3. PHP 7.1.x is no longer found on this PHP downloads page and should be removed from check-versions/tests/VersionTest.php. I first thought it was the reason why I was getting the following error message, but realized it's happening for another reason—which I'm not exactly clear on yet.

    Step #1: Time: 4.48 seconds, Memory: 10.00MB
    Step #1: 
    Step #1: There were 2 failures:
    Step #1: 
    Step #1: 1) VersionTest::testPHP71Version
    Step #1: Failed to detect the current php71 version
    Step #1: 
    Step #1: /workspace/tests/VersionTest.php:58
    Step #1: 
    Step #1: 2) VersionTest::testPHP72Version
    Step #1: Failed to detect the current php72 version
    Step #1: 
    Step #1: /workspace/tests/VersionTest.php:69
    Step #1: 
    Step #1: FAILURES!
    Step #1: Tests: 2, Assertions: 0, Failures: 2.
    Finished Step #1
    ERROR
    ERROR: build step 1 "gcr.io/[secure]/php-test-runner:travis-695561465" failed: step exited with non-zero status: 1
    --------------------------------------------------------------------------------
    The command "scripts/check_versions.sh" exited with 1.
    

I'm a big fan of GAE, which I recommend to clients and use for many PHP & Node projects. However, without some updates to these PHP containers for flex I am starting to consider other options like GKE or custom images. I'd much rather use the default images though. This project is starting to appear abandoned and not safe for production workloads. I am more than happy to contribute time and energy to this project but would need a little help with the initial setup of the CI/CD pipeline.

@derekherman
Copy link
Author

@tmatsuo, @chingor13, @donmccasland who is responsible for this repository now?

@johnhout
Copy link

johnhout commented Aug 6, 2020

Same here :) it's starting to be a security risk now @tmatsuo, @chingor13, @donmccasland, @tmatsuo, @deustis, @bendory, @nkubala Also it seems since this message @donmccasland has fixed alot but why is there no release yet? And where can we help?

@donmccasland
Copy link
Member

Hey folks, just getting back from vacation. I finished work on 7.3 and I will be able to release it tomorrow.

I can review #510 and merge it.

We need to deprecate 7.1 since it is no longer being updated, but we will need to announce the deprecation to customers.

@derekherman
Copy link
Author

That’s great! Thank you very much for the update. Is there a way to test it before the release?

@johnhout
Copy link

johnhout commented Aug 7, 2020

That's awesome! @donmccasland is there something we can do to help implementing php 7.4 (per pull request)? if so glad to do this. So we can speed up the release time 👍

@derekherman
Copy link
Author

@donmccasland any update here on tagging the new version for PHP 7.3?

@derekherman
Copy link
Author

@donmccasland I tried to deploy the 7.3 image to a staging App Engine flex environment with the php runtime and it says it only supports 7.2. Does someone need to update something on the GCP side to allow us to use this image now?

@donmccasland
Copy link
Member

donmccasland commented Aug 17, 2020 via email

@derekherman
Copy link
Author

Thank you @donmccasland

@derekherman
Copy link
Author

@donmccasland any updates on when 7.3 will be supported on App Engine flex with the php runtime?

@veneliniliev
Copy link

or 7.4 :/

@derekherman
Copy link
Author

Looks like it's supported on App Engine now, which is great. However, it would be nice to get the latest version 7.3.23 deployed to the image though, it's currently 7.3.19. @donmccasland can we do a build and deploy for the latest stable version of PHP 7.3? In reality I'd actually love to get this setup in a fork to create PRs and help move things forward. Cheers!

@frost-byte
Copy link
Contributor

I'm trying to do the same thing that @derekherman was trying to do before.
How exactly are we supposed to verify or test any changes we make? I cannot build the images for myself because I do not have access to the gcp-php-packages bucket.

Is there any documentation about this? I'd like to try deploying a 7.4 image, it looks like someone had that functionality merged, but there is currently a typo within the Dockerfile.

@frost-byte
Copy link
Contributor

frost-byte commented Apr 5, 2021

I've been struggling with this some, but I was able to use the TRAVIS.md to get started.
The first issue I discovered is that the travis build was failing because gcloud had not been properly authorized.
I found an example from another gcp project for a different runtime. So I was able to fix that issue.
The next problem comes from the fact that anything older than 7.3 is no longer supported.

The check_versions phpunit test script VersionTest.php scrapes the php.net/downloads page and tries to match those unsupported versions and fails. Currently the downloads page has the latest versions for 7.3, 7.4 and 8.0

Another issue related to this unit test, is that it looks for artifacts/packages for versions using apt-cache madison. These are packages that appear to be built by @tmatsuo. (gcp-php71, gcp-php72, gcp-php73, etc) If you use apt-cache show, then you can functionally accomplish the same test, as it just confirms that the packages are available. If you wanted to create packages for 7.4 and 8.0 and add them as tests, then you need to build them first. (I assume it would be possible to point to your own custom artifacts, otherwise it would require someone who manages this repo to build and publish them?)

That's the part I'm trying to work out now. I've been able to follow the instructions in package-builder/README.md, but it takes over an hour to build, and it fails. (trying to build 8.0.3) I've updated the apt packages to include onigumura and valgrind. I saw a few errors about certain functionality being disabled, mostly related to various image processing libraries: OpenSlide, pango, imagequant, and a few others. I'm not sure if some of these are new, usually disabled, or provided via extensions.

I've never built php before and don't know if there are security issues with any of them, or if they're too intensive for an App Engine environment.

There are a handful of environment variables that you need to set or specify when running some of the scripts. Most of them use cloud build to run, including the ones used by travis, but you can execute them locally if you have gcloud installed and configured to use the same service account you'd create if you follow the suggestions in TRAVIS.md

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants