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

Trigger Ephemeral Test Workflows #506

Merged
merged 60 commits into from
Sep 29, 2022
Merged

Trigger Ephemeral Test Workflows #506

merged 60 commits into from
Sep 29, 2022

Conversation

rfuelsh
Copy link
Member

@rfuelsh rfuelsh commented Jul 26, 2022

Remotely dispatch Deploy and Delete Test Workflow Environments in Fuel-Deployment

Deploy ephemeral test workflow:

@rfuelsh rfuelsh changed the title Create eph envs workflows [Draft] Create eph envs workflows Jul 26, 2022
@rfuelsh rfuelsh self-assigned this Jul 27, 2022
@rfuelsh rfuelsh changed the title [Draft] Create eph envs workflows Trigger Ephemeral Test Workflows Jul 31, 2022
@rfuelsh rfuelsh closed this Aug 16, 2022
@rfuelsh rfuelsh reopened this Aug 16, 2022
@rfuelsh
Copy link
Member Author

rfuelsh commented Aug 16, 2022

TEST RESULTS:

  1. Deploy Eph ENV based on branch "create-eph-envs-workflows" on PR Trigger Ephemeral Test Workflows #506

Fuel Core Action: https://github.com/FuelLabs/fuel-core/actions/runs/2864783926

Fuel Deployment Action: https://github.com/FuelLabs/fuel-deployment/actions/runs/2864820823

% kubectl get ns
NAME STATUS AGE
amazon-cloudwatch Active 95d
cert-manager Active 152d
default Active 200d
elastic-system Active 88d
fuel-core Active 122d
fuel-core-preview-create-eph-envs-workflows Active 2m30s
fuel-dev Active 101d
fuel-k8s-operator-system Active 25d
ingress-nginx Active 151d
kube-node-lease Active 200d
kube-public Active 200d
kube-system Active 200d
logging Active 88d
monitoring Active 160d
rustometer Active 95d
testnet-01-preview Active 97d

% kubectl get deployment fuel-core-k8s -o yaml -n fuel-core-preview-create-eph-envs-workflows | grep image
image: ghcr.io/fuellabs/fuel-core:sha-14fdd6d
imagePullPolicy: Always

% helm list --namespace fuel-core-preview-create-eph-envs-workflows
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
fuel-core fuel-core-preview-create-eph-envs-workflows 1 2022-08-16 02:21:52.625624793 +0000 UTC deployed fuel-core-0.1.0 0.10.1

% kubectl get all -n fuel-core-preview-create-eph-envs-workflows
NAME READY STATUS RESTARTS AGE
pod/fuel-core-k8s-8698c8dbdc-5hpzl 1/1 Running 0 3m9s

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/fuel-core-service NodePort 172.20.87.155 80:32412/TCP 3m9s

NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/fuel-core-k8s 1/1 1 1 3m9s

NAME DESIRED CURRENT READY AGE
replicaset.apps/fuel-core-k8s-8698c8dbdc 1 1 1 3m9s

  1. Closed this PR manually - Trigger Ephemeral Test Workflows #506

Hence Delete Eph ENV "fuel-core-preview-create-eph-envs-workflows" namespace

Fuel Core Action: https://github.com/FuelLabs/fuel-core/actions/runs/2864840718

Fuel Deployment Action: https://github.com/FuelLabs/fuel-deployment/actions/runs/2864841647

% kubectl get ns
NAME STATUS AGE
amazon-cloudwatch Active 95d
cert-manager Active 152d
default Active 200d
elastic-system Active 88d
fuel-core Active 123d
fuel-dev Active 101d
fuel-k8s-operator-system Active 25d
ingress-nginx Active 151d
kube-node-lease Active 200d
kube-public Active 200d
kube-system Active 200d
logging Active 88d
monitoring Active 160d
rustometer Active 95d
testnet-01-preview Active 97d

@Voxelot
Copy link
Member

Voxelot commented Aug 31, 2022

This looks good but I have one concern with this approach. If we build the docker image for fuel-core when the PR is opened, this will bypass our normal flow for only building the docker image after unit tests and other CI checks have passed.

I'll request the following changes:

  • Remove docker build steps from the PR opening workflow
  • When the PR is opened, just deploy the latest image from master
  • Once the latest commit passes basic build checks, only then should it be deployed to the ephemeral env (using the same deploy job we already have)

@rfuelsh
Copy link
Member Author

rfuelsh commented Sep 25, 2022

the logic suggested has been implemented here is using ci.yaml to deploy to new ephemeral env using sha image tag built:

https://github.com/FuelLabs/fuel-core/actions/runs/3120881863

@rfuelsh
Copy link
Member Author

rfuelsh commented Sep 28, 2022

@Voxelot - can I get a review please of this ? thanks

@Voxelot
Copy link
Member

Voxelot commented Sep 28, 2022

The changes here look good, this is exactly what I had in mind 👍🏻

Any idea why nginx is returning a 404? http://fuel-core-preview-create-eph-envs-worksflows.swayswap.io/health

I was able to port-forward to fuel-core-service and hit the health endpoint at localhost:4000/health so it's not an issue with the container. The ingress also looks like it's correctly pointing at fuel-core-service 🤔

Is it possible the long URL is causing problems?

@Voxelot
Copy link
Member

Voxelot commented Sep 28, 2022

Another last-minute thought I had, is that we should use a branch prefix scheme to selectively enable these jobs. That way PRs unrelated to code changes (such as docs / readme updates) don't thrash our dev cluster.

This could be a prefix like preview/*, to enable an automated preview environment for the branch.

@rfuelsh rfuelsh merged commit ee8cd42 into master Sep 29, 2022
@rfuelsh rfuelsh deleted the create-eph-envs-workflows branch September 29, 2022 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Build Fuel-Core Workflow to Trigger Fuel-Deployment Create Ephemeral Enviromment Workflow
4 participants