Skip to content

Commit

Permalink
Remove GCP
Browse files Browse the repository at this point in the history
  • Loading branch information
curquiza committed Jan 16, 2025
1 parent f321574 commit a2baa66
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 76 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/manual_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
options:
- "amazon-ebs"
- "digitalocean"
- "googlecompute"
required: true

env:
Expand All @@ -25,17 +24,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'

- name: Setup `packer`
uses: hashicorp/setup-packer@main
with:
version: ${{ env.PACKER_VERSION }}

- name: Run `packer init`
run: "packer init ."

- name: Run `packer build`
run: "packer build -only ${{ github.event.inputs.provider }}.debian ."
8 changes: 2 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'

- name: Setup `packer`
uses: hashicorp/setup-packer@main
with:
version: ${{ env.PACKER_VERSION }}

- name: Run `packer init`
run: "packer init ."

- name: Run `packer validate`
run: "packer validate ."

- name: Run `packer build`
run: "packer build ."
31 changes: 0 additions & 31 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ Before running any script, make sure to [obtain a DigitalOcean API Token](https:
```bash
export DIGITALOCEAN_ACCESS_TOKEN="XxXxxxxXXxxXXxxXXxxxXXXxXxXxXX"
```
- GCP:
Obtain your [GCP credentials](https://cloud.google.com/docs/authentication/getting-started) and set it in your environment:
```bash
export GOOGLE_APPLICATION_CREDENTIALS="path_to_your_creadential_file.json"
```
3. Download and install Packer plugins
``` bash
packer init .
```

### Tests and Linter <!-- omit in toc -->

Expand Down Expand Up @@ -190,21 +181,6 @@ In the [DigitalOcean Vendor Portal](https://cloud.digitalocean.com/vendorportal)

This will start the DigitalOcean review process. This can take a few days, and the result will be notified via email to the DigitalOcean admin account. If the image is accepted, it will be automatically published on the Marketplace. If it is rejected, an email explaining the problems will be sent to administrators.

### Create the Virtual disk (VMDK) for GCP <!-- omit in TOC -->
In the [GCP console](https://console.cloud.google.com/)
- Ensure you selected the `MeiliSearchImage` project in the GCP console
- Navigate to "Compute Engine" -> "Images"
- Click on the image you just created `meilisearch-X-X-X-debian-X`
- Click on `EXPORT`
- On: "Export format" choose `VMDK`
- On: "Path*" click on `BROWSE` and select `meilisearch-image`
- Validate it by clicking on the SELECT button at the bottom
- Finally click on the EXPORT button at the buttom
The new image should appear in the list. It might take a few minutes.
## Cleaning old images (Optional)

You may want to clean up the old images.
Expand All @@ -218,13 +194,6 @@ However if you have made a copy so that it is available from the dashboard:
- Go to Images -> Manage (left side bar)
- On the list of image, for the chosen image, click on `More` -> `Delete`

### GCP
- Go to Cloud-storage: [GCP console](https://console.cloud.google.com/) > Cloud Storage
- Click on `meilisearch-image``. You will have access to a list of all vdmk images
- Select the images you wish to delete
- Click on DELETE (at top of the list)
### AWS

- Download this [repository](https://github.com/meilisearch/meilisearch-aws) (don't worry it's an archived repository but we can still use the script)
Expand Down
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ These Packer build configurations are used primarily by the Meilisearch integrat
|----------|
| AWS |
| DigitalOcean |
| GCP |
| GCP - ⚠️ Deprecated, no more image published anymore |

## 📖 Documentation

Expand All @@ -62,7 +62,6 @@ You need the following to run the template:
1. The [Packer CLI v1.8.6+](https://developer.hashicorp.com/packer/downloads) installed locally
2. Obtain your [AWS access keys](https://docs.aws.amazon.com/keyspaces/latest/devguide/access.credentials.html)
3. Obtain your [DigitalOcean API Token](https://www.digitalocean.com/docs/apis-clis/api/create-personal-access-token/)
4. Obtain your [GCP credentials](https://cloud.google.com/docs/authentication/application-default-credentials)

## 🔑 Set your credentials

Expand All @@ -75,10 +74,6 @@ export AWS_SECRET_ACCESS_KEY="YOUR_SECRET_KEY"
```bash
export DIGITALOCEAN_TOKEN="XxXxxxxXXxxXXxxXXxxxXXXxXxXxXX"
```
- GCP
```bash
export GOOGLE_APPLICATION_CREDENTIALS="path_to_your_creadential_file.json"
```

## 🚀 Getting Started

Expand Down Expand Up @@ -109,14 +104,9 @@ packer build -only 'amazon-ebs.*' .
packer build -only 'digitalocean.*' .
```

``` bash
packer build -only 'googlecompute.*' .
```

## 🚀 How to deploy Meilisearch
## 🚀 How to deploy Meilisearch

If you want to learn how to deploy a Meilisearch instance on DigitalOcean visit the dedicated page of our documentation:
- [AWS](https://www.meilisearch.com/docs/guides/deployment/aws)
- [DigitalOcean](https://www.meilisearch.com/docs/guides/deployment/digitalocean)
- [GCP](https://www.meilisearch.com/docs/guides/deployment/gcp)

21 changes: 0 additions & 21 deletions meilisearch.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ packer {
version = "~> 1"
source = "github.com/digitalocean/digitalocean"
}
googlecompute = {
version = "~> 1"
source = "github.com/hashicorp/googlecompute"
}
}
}

Expand Down Expand Up @@ -88,19 +84,10 @@ source "digitalocean" "debian" {
]
}

source "googlecompute" "debian" {
image_name = lower(replace("${var.image_name}-${var.meilisearch_version}-${var.base-os-version}", ".", "-"))
project_id = "meilisearchimage"
source_image_family = "debian-11"
ssh_username = "packer"
zone = "us-central1-a"
}

build {
sources = [
"source.amazon-ebs.debian",
"source.digitalocean.debian",
"source.googlecompute.debian"
]

provisioner "file" {
Expand Down Expand Up @@ -167,12 +154,4 @@ build {
only = ["digitalocean.debian"]
}

// This prevents image creation failure when Install guest packages is checked.
provisioner "shell" {
execute_command = "echo 'packer' | sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
inline = [
"sudo apt-get remove google-cloud-cli -y",
]
only = ["googlecompute.debian"]
}
}

0 comments on commit a2baa66

Please sign in to comment.