Skip to content

Conversation

@MOBergeron
Copy link
Collaborator

No description provided.

@MOBergeron MOBergeron marked this pull request as ready for review November 29, 2025 03:23
@MOBergeron MOBergeron requested review from MaxNad and Res260 November 29, 2025 03:23

if "}" == line and name:
tracks.add(
Track(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

messemble que ce code là est weird. Tu crées une Track et un des paramètres au constructeur est has_virtual_machine et pour savoir ça tu crées une autre Track? Ça l'air redondant

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est que pour la constance j'ai voulu répliqué la fonction does track needs build container. Mais ce n'était pas la bonne solution effectivement. Je devrais prendre un str ou Track, puis de là faire le traitement. Ça éviterait de créer un objet nowhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est fait.

ctf/utils.py Outdated
) and bool(load_yaml_file(build_yaml_file_path))


def does_track_has_virtual_machine(track: Track) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soit does_track_have_virtual_machine() ou track_has_virtual_machine(). Je préfère 2e option perso

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est fait.

ansible_incus_host: build-container
{% endif %}{% if data.is_windows %}
# This section is needed if you need Windows virtual machines. It's a group of hosts regrouped under the name "windows" which MUST remain the same.
# The group "windows" is removed from the "cleanup.yaml" and "common.yaml", which is why you should not change it.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pas sûr de comprendre cette ligne. le groupe windows est retiré de cleanup.yaml et common.yaml, mais ta PR ne modifie pas ces fichiers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je les ai enlevé sur mon instance local de ctf. Mais j'ai oublié de l'enlever des fichiers templates, ouch. Good catch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est fait.

profiles = ["default", incus_profile.this.name]
type = {% if data.is_windows %}"virtual-machine"{% else %}"container"{% endif %}

image = {% if data.is_windows %}"CHANGE_ME" # Change to the Windows image location{% else %}"images:ubuntu/24.04"{% endif %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mettre instructions sur comment trouver cette image location?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Je pourrais. C'est une image self created dans Incus... Stéphane parlait d'avoir des pourparlers avec Microsoft pour avoir des images Windows dans Incus mais ce n'est pas fait encore. Mais oui. C'est compliqué par contre de dire exactement comment faire une image locale. Faudrait que je pointe vers le README et expliquer comment faire dans le README.

# Waiting for virtual machine to be up and running
# Starting with a minute
if start_timer > time.time() - (seconds := 60.0):
LOG.info(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ça serait mieux d'utiliser https://rich.readthedocs.io/en/latest/progress.html à la place

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pas certain de comprendre comment utiliser progress, surtout dans ce contexte. Penses-tu pouvoir t'en occuper?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je sais pas comment utiliser ça. Quel nom d'image windows je peux utiliser?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu dois créer ta propre image avec incus-windows par antifob, voir le README.

ctf/deploy.py Outdated

match s.returncode:
case 127:
# What else should be put here?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jcomprend pas, pourquoi ce case et debug log?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Une VM pourrait être Windows ou Linux. Donc il faut une commande commune dans chaque OS. Et si le binaire n'est pas trouvé, j'essaie avec un autre binaire. Au pire on pourrait commencer par cmd puis aller vers sh après si sh existe sur tous les Unix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai changé un peu le commentaire.

@MOBergeron MOBergeron force-pushed the windows-vm branch 4 times, most recently from 7ea5f0c to 074e004 Compare December 1, 2025 02:41
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.

2 participants