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

docs: update codespaces install, fixes #85 #86

Closed
wants to merge 1 commit into from

Conversation

rfay
Copy link
Member

@rfay rfay commented Aug 21, 2023

@rfay
Copy link
Member Author

rfay commented Aug 21, 2023

I failed again and did this on my fork.

@rfay
Copy link
Member Author

rfay commented Aug 21, 2023

Please take a look @mandrasch

@mandrasch
Copy link
Contributor

mandrasch commented Aug 21, 2023

I failed again and did this on my fork.

Hey! Sure thing.

What fork did you use exactly? https://github.com/rfay/ddev with main branch? The main branch of your fork does not have a .devcontainer/devcontainer.json yet as far as I could see. Therefore project configuration does not exist.

image

When I use https://github.com/ddev/ddev, it offers me "Go" (because I forgot to change remove the name in line https://github.com/ddev/ddev/blob/master/.devcontainer/devcontainer.json#L4C2-L4C2). But this is correct and uses universal image.

image

So important thing is that projects need already a valid devcontainer.json to add install-ddev feature, the guide does not state this yet.

Also an odd thing is port 8080 is not used in the d9 sample project:

image image

The sample project is instead running on https://laughing-guacamole-9p595g9gph7q6-32771.app.github.dev/ 32771 🤔

But the ddev setup sh does work very different than the ones I use.

@mandrasch
Copy link
Contributor

mandrasch commented Aug 21, 2023

Regarding the "get started" guide in general:

Should we we provide a simple example repository?

I quite liked the idea of the d9-simple sample project inside ddev repo, but maybe something more easy like index.php with "hello world!" would also be sufficient to get the core idea of DDEV + php in the cloud? Something like ddev/codespaces-demo e.g. which uses the devcontainer.json of https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/#github-codespaces?

Or we provide the full working .devcontainer/devcontainer.json which people can copy into their project
(https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/#github-codespaces) in this guide on ddev.com?

{
  "image": "mcr.microsoft.com/devcontainers/universal:2",
  "features": {
    "ghcr.io/ddev/ddev/install-ddev:latest": {}
  },
  "portsAttributes": {
    "3306": {
      "label": "database"
    },
    "8027": {
      "label": "mailhog"
    },
    "8080": {
      "label": "web http"
    },
    "8443": {
      "label": "web https"
    }
  },
 "postCreateCommand": "chmod +x .devcontainer/setup_project.sh && .devcontainer/setup_project.sh"
}
#!/bin/bash
set -ex
ddev config global --omit-containers=ddev-router
ddev debug download-images

# catch rebuilds
ddev poweroff

# start ddev project
ddev start -y

# normal project setup
ddev composer install 

Both ways would be helpful I guess ...

@mandrasch
Copy link
Contributor

Or we just provide the link to https://github.com/ddev/d9simple, just realized by now that this is already a separate repository. :-)

@mandrasch
Copy link
Contributor

mandrasch commented Aug 21, 2023

Or we just provide the link to https://github.com/ddev/d9simple, just realized by now that this is already a separate repository. :-)

Updated the d9simple repo here: https://github.com/mandrasch/d9simple/tree/feat-remove-docker-in-docker, can submit this as PR.

Selected mandrasch/d9simple and feat-remove-docker-in-docker branch:
image

Launching this via "create new codespace" worked fine.

Just need to add the db import scripts as well from https://github.com/ddev/ddev/blob/master/.devcontainer/setup_test_project.sh, if this should be used as official example:

    DDEV_ARTIFACTS=${DDEV_REPO}-artifacts
    git clone ${DDEV_ARTIFACTS} "/tmp/${DDEV_ARTIFACTS##*/}" || true
    ...
    ddev import-db --file=/tmp/${DDEV_ARTIFACTS##*/}/db.sql.gz
    ddev import-files --source=/tmp/${DDEV_ARTIFACTS##*/}/files.tgz
    ...

@rfay
Copy link
Member Author

rfay commented Aug 21, 2023

I failed again and did this on my fork.

Sorry, I just meant that to get the proper preview here in ddev.com-front-end I can't use a fork when doing a PR because the automated build doesn't happen then. I gave an image from my local though.

@rfay
Copy link
Member Author

rfay commented Aug 21, 2023

Now... I didn't understand if you approved of this and it accomplished your goal or not.

@mandrasch
Copy link
Contributor

mandrasch commented Aug 22, 2023

Hi, sorry for confusion, was a bit late yesterday in austria. 😉 😴

Review:

Needs more work.

I would propose we take a step back, the current guide on ddev.com can be confusing for new users since some crucial information is missing.

A good first solution for me would be to copy the updated tutorial from docs to ddev.com as well: https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/#github-codespaces

Especially this part is missing on ddev.com:

image

Optional side note: In my humble opinion we could shorten down this guide if we just instruct users to create a new file .devcontainer/devcontainer.json. The "configure devcontainer command" just provides the universal image with no further information:

image

With using the same guide we would not have to verify two different guides.

@rfay
Copy link
Member Author

rfay commented Aug 22, 2023

Let's finish the in-play work on

then and we'll come back to this here.

My basic thinking is that we should make it much simpler over there. It's already so much harder than gitpod, and we need to fine tune what we're asking them to do.

@rfay rfay closed this Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants