Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.

Commit 38ee166

Browse files
musebcfacebook-github-bot
authored andcommitted
Back out "Update the existing Build Images workflow to build all FBPCS images and run on pull requests." (#2206)
Summary: Pull Request resolved: #2206 Builds fail from PR created in forks. Backing out for now until I can resolve that. Reviewed By: jrodal98 Differential Revision: D44184136 fbshipit-source-id: ceedab8d1c0aad2e2a9ed340f4f2cd3b017091c5
1 parent c8db2fa commit 38ee166

File tree

6 files changed

+61
-83
lines changed

6 files changed

+61
-83
lines changed

.github/workflows/build_binary_image.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ on:
3131
env:
3232
DISTRO: ubuntu
3333
REGISTRY: ghcr.io
34-
RC_REGISTRY_URL: ghcr.io/${{ github.repository }}/rc/
34+
RC_REGISTRY_IMAGE_URL: ghcr.io/${{ github.repository }}/rc/
3535

3636
jobs:
3737
build_image:
@@ -44,14 +44,17 @@ jobs:
4444
steps:
4545
- uses: actions/checkout@v3
4646

47-
- name: Get Docker Image Name
48-
id: get_docker_image_name
49-
run: |
50-
echo "image_tag_name=$(echo ${{ inputs.image_to_build }} | tr '_' '-')" >> $GITHUB_OUTPUT
51-
5247
- name: Set up Docker Buildx
5348
uses: docker/setup-buildx-action@v2
5449

50+
- name: Cache Docker layers
51+
uses: actions/cache@v3
52+
with:
53+
path: /tmp/.buildx-cache
54+
key: ${{ runner.os }}-${{ inputs.image_to_build }}-${{ github.ref_name }}
55+
restore-keys: |
56+
${{ runner.os }}-${{ inputs.image_to_build }}
57+
5558
- name: Pull FBPCF Image
5659
run: docker pull ghcr.io/facebookresearch/fbpcf/ubuntu:${{ inputs.fbpcf_version }}
5760

@@ -68,12 +71,22 @@ jobs:
6871
context: .
6972
file: docker/${{ inputs.image_to_build }}/Dockerfile.ubuntu
7073
tags: |
71-
${{ env.RC_REGISTRY_URL }}${{ steps.get_docker_image_name.outputs.image_tag_name }}:${{ github.sha }}
74+
${{ env.RC_REGISTRY_IMAGE_URL }}${{ inputs.image_to_build }}:${{ github.sha }}
7275
build-args: |
7376
tag=latest
7477
os_release=20.04
7578
fbpcf_image=ghcr.io/facebookresearch/fbpcf/ubuntu:${{ inputs.fbpcf_version }}
7679
push: ${{ inputs.push_to_registry }}
7780
load: ${{ inputs.load_image_locally }}
78-
cache-from: type=gha,scope=${{ steps.get_docker_image_name.outputs.image_tag_name }}-${{ github.ref_name }}
79-
cache-to: type=gha,scope=${{ steps.get_docker_image_name.outputs.image_tag_name }}-${{ github.ref_name }},mode=max
81+
cache-from: type=local,src=/tmp/.buildx-cache
82+
cache-to: type=local,dest=/tmp/.buildx-cache-new
83+
84+
# This ugly bit is necessary or else our cache will grow forever
85+
# until it hits GitHub's limit of 5GB.
86+
# Temp fix: T135482742
87+
# https://github.com/docker/build-push-action/issues/252
88+
# https://github.com/moby/buildkit/issues/1896
89+
- name: Move cache
90+
run: |
91+
rm -rf /tmp/.buildx-cache
92+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
name: Build, Test, and Publish the FBPCS Docker Images
1+
name: Build and Publish Data Processing and EMP Games Docker Images
22

33
on:
44
push:
55
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
86

97
env:
10-
FBPCF_VERSION: 2.1.132 # Please also update line 25 in .github/workflows/docker-publish.yml
11-
PID_VERSION: 0.0.8 # Please also update line 26 in .github/workflows/docker-publish.yml
8+
FBPCF_VERSION: 2.1.132 # Please also update line 29 in .github/workflows/docker-publish.yml
129
REGISTRY: ghcr.io
13-
LOCAL_IMAGE_NAME: fbpcs/onedocker/test
14-
RC_REGISTRY_URL: ghcr.io/${{ github.repository }}/rc
15-
RC_REGISTRY_IMAGE_NAME: ghcr.io/${{ github.repository }}/rc/onedocker
1610

1711
jobs:
1812
output_version:
@@ -24,12 +18,6 @@ jobs:
2418
- id: set_version
2519
run: echo "version=${{ env.FBPCF_VERSION }}" >> $GITHUB_OUTPUT
2620

27-
build_coordinator_image:
28-
name: Build the Coordinator image
29-
uses: ./.github/workflows/coordinator-publish.yml
30-
with:
31-
new_tag: ${{ github.sha }}
32-
3321
build_and_publish_data_processing_image:
3422
name: Build and Publish Data Processing Image
3523
needs: output_version
@@ -49,37 +37,3 @@ jobs:
4937
tag: latest
5038
fbpcf_version: ${{needs.output_version.outputs.fbpcf_version}}
5139
push_to_registry: true
52-
53-
build_test_onedocker_image:
54-
name: Build the bundled test version of the onedocker image
55-
needs: [build_and_publish_data_processing_image, build_and_publish_emp_games_image]
56-
runs-on: ubuntu-latest
57-
steps:
58-
- uses: actions/checkout@v3
59-
60-
- name: Set up Docker Buildx
61-
uses: docker/setup-buildx-action@v2
62-
63-
- name: Log into registry ${{ env.REGISTRY }}
64-
uses: docker/login-action@v2
65-
with:
66-
registry: ${{ env.REGISTRY }}
67-
username: ${{ github.actor }}
68-
password: ${{ secrets.GITHUB_TOKEN }}
69-
70-
- name: Build Image
71-
uses: docker/build-push-action@v3
72-
with:
73-
context: .
74-
file: docker/onedocker/test/Dockerfile.ubuntu
75-
tags: |
76-
${{ env.RC_REGISTRY_IMAGE_NAME }}:${{ github.sha }}
77-
build-args: |
78-
tag=${{ github.sha }}
79-
os_release=20.04
80-
private_id_tag=${{ env.PID_VERSION }}
81-
repository_url=${{ env.RC_REGISTRY_URL }}
82-
push: true
83-
pull: true
84-
cache-from: type=gha,scope=onedocker-test-${{ github.ref_name }}
85-
cache-to: type=gha,scope=onedocker-test-${{ github.ref_name }},mode=max

.github/workflows/coordinator-publish.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Publish Coordinator Image
33
on:
44
workflow_dispatch:
55
inputs:
6+
name:
7+
description: "Manually running this workflow to build a coordinator image"
8+
default: "Run"
69
new_tag:
710
description: "The new tag of the docker image"
811
required: false
@@ -11,18 +14,7 @@ on:
1114
tracker_hash:
1215
description: "[Internal usage] Used for tracking workflow job status within Meta infra"
1316
required: false
14-
type: string
15-
workflow_call:
16-
inputs:
17-
new_tag:
18-
description: "The new tag of the docker image"
19-
required: false
20-
type: string
21-
default: latest-build
22-
tracker_hash:
23-
description: "[Internal usage] Used for tracking workflow job status within Meta infra"
24-
required: false
25-
type: string
17+
type: str
2618

2719
env:
2820
DISTRO: ubuntu
@@ -39,29 +31,32 @@ jobs:
3931
packages: write
4032

4133
steps:
42-
- uses: actions/checkout@v3
43-
34+
- uses: actions/checkout@v2
4435
- name: Print Tracker Hash
45-
run: echo ${{ inputs.tracker_hash }}
36+
run: echo ${{ github.event.inputs.tracker_hash }}
4637

4738
- name: Build image
4839
run: |
49-
docker build --build-arg FBPCS_BUNDLE_ID=${{ inputs.new_tag }} -f ./fbpcs/Dockerfile -t ${{ env.LOCAL_IMAGE_NAME }}:${{ inputs.new_tag }} .
40+
docker build --build-arg FBPCS_BUNDLE_ID=${{ github.event.inputs.new_tag }} -f ./fbpcs/Dockerfile -t ${{ env.LOCAL_IMAGE_NAME }}:${{ github.event.inputs.new_tag }} .
5041
5142
# Tests will be added here
5243

5344
- name: Log into registry ${{ env.REGISTRY }}
54-
uses: docker/login-action@v2
45+
uses: docker/login-action@v1
5546
with:
5647
registry: ${{ env.REGISTRY }}
5748
username: ${{ github.actor }}
5849
password: ${{ secrets.GITHUB_TOKEN }}
5950

51+
- name: Set output
52+
id: vars
53+
run: echo ::set-output name=ref::${GITHUB_REF##*/}
54+
6055
- name: Tag docker image
6156
run: |
62-
docker tag ${{ env.LOCAL_IMAGE_NAME }}:${{ inputs.new_tag }} ${{ env.REGISTRY_IMAGE_NAME }}:${{ github.sha }}
63-
${{ ! contains(github.ref, 'refs/pull') }} && docker tag ${{ env.LOCAL_IMAGE_NAME }}:${{ inputs.new_tag }} ${{ env.REGISTRY_IMAGE_NAME }}:${{ github.ref_name }}
64-
docker tag ${{ env.LOCAL_IMAGE_NAME }}:${{ inputs.new_tag }} ${{ env.REGISTRY_IMAGE_NAME }}:${{ inputs.new_tag }}
57+
docker tag ${{ env.LOCAL_IMAGE_NAME }}:${{ github.event.inputs.new_tag }} ${{ env.REGISTRY_IMAGE_NAME }}:${{ github.sha }}
58+
docker tag ${{ env.LOCAL_IMAGE_NAME }}:${{ github.event.inputs.new_tag }} ${{ env.REGISTRY_IMAGE_NAME }}:${{ steps.vars.outputs.ref }}
59+
docker tag ${{ env.LOCAL_IMAGE_NAME }}:${{ github.event.inputs.new_tag }} ${{ env.REGISTRY_IMAGE_NAME }}:${{ github.event.inputs.new_tag }}
6560
6661
- name: Push image to registry
6762
run: |

.github/workflows/docker-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ env:
2222
PL_CONTAINER_NAME: e2e_pl_container
2323
PA_CONTAINER_NAME: e2e_pa_container
2424
TIME_RANGE: 24 hours
25-
FBPCF_VERSION: 2.1.132 # Please also update line 10 in .github/workflows/build_fbpcs_images.yml
26-
PID_VERSION: 0.0.8 # Please also update line 11 in .github/workflows/build_fbpcs_images.yml
25+
FBPCF_VERSION: 2.1.132 # Please also update line 8 in .github/workflows/build_fbpcs_images.yml
26+
PID_VERSION: 0.0.8
2727

2828
jobs:
2929
### Build and publish rc/onedocker image

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Test building image
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
building_image:
11+
runs-on: ubuntu-20.04
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Build image
17+
run: |
18+
./build-docker.sh onedocker

docker/onedocker/test/Dockerfile.ubuntu

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
ARG os_release="20.04"
66
ARG tag="latest"
77
ARG private_id_tag="latest"
8-
# Use the local repository as default
9-
ARG repository_url="fbpcs"
10-
FROM ${repository_url}/data-processing:${tag} as data_processing
11-
FROM ${repository_url}/emp-games:${tag} as emp_games
8+
FROM fbpcs/data-processing:${tag} as data_processing
9+
FROM fbpcs/emp-games:${tag} as emp_games
1210
FROM ghcr.io/facebookresearch/private-id:${private_id_tag} as private_id
1311

1412
FROM ubuntu:${os_release}

0 commit comments

Comments
 (0)